Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - HAM undefined reference - QNX 6.3.2 IDE 4.0.1: (4 Items)
   
HAM undefined reference - QNX 6.3.2 IDE 4.0.1  
I am trying to use the HAM. I have tried the following code from the user guide:

#include "ha\ham.h"
...
ham entity t *ehdl; /* The entity Handle */
int status;
/*
connects to a HAM with a heartbeat of 5 seconds
and an entity name of "client1", and no flags
it also specifies hpdh = 4, and hpdh = 8
*/
ehdl = ham attach self("client1", 5000000000, 4, 8, 0);
if (ehdl == NULL) {
printf("Could not attach to Ham\n");
exit(-1);
}
/* Detach from a HAM using the original handle */
status = ham_detach_self(ehdl,0);
...

I am getting the following compiler errors:
.c undefined reference to `ham_attach_self'
.c undefined reference to `ham_detach_self'
.o undefined reference to `ham_attach_self'
.o undefined reference to `ham_detach_self'

What should I link? What am I missing?

Thank you in advance.
RE: HAM undefined reference - QNX 6.3.2 IDE 4.0.1  
I think you need to link against libham. There's also a libha that some
functions live in.

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Lucian Grossmann [mailto:community-noreply@qnx.com] 
> Sent: Monday, January 31, 2011 8:53 AM
> To: general-ide
> Subject: HAM undefined reference - QNX 6.3.2 IDE 4.0.1
> 
> I am trying to use the HAM. I have tried the following code 
> from the user guide:
> 
> #include "ha\ham.h"
> ...
> ham entity t *ehdl; /* The entity Handle */
> int status;
> /*
> connects to a HAM with a heartbeat of 5 seconds
> and an entity name of "client1", and no flags
> it also specifies hpdh = 4, and hpdh = 8
> */
> ehdl = ham attach self("client1", 5000000000, 4, 8, 0);
> if (ehdl == NULL) {
> printf("Could not attach to Ham\n");
> exit(-1);
> }
> /* Detach from a HAM using the original handle */
> status = ham_detach_self(ehdl,0);
> ...
> 
> I am getting the following compiler errors:
> .c undefined reference to `ham_attach_self'
> .c undefined reference to `ham_detach_self'
> .o undefined reference to `ham_attach_self'
> .o undefined reference to `ham_detach_self'
> 
> What should I link? What am I missing?
> 
> Thank you in advance.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post82771
> 
> 
AW: HAM undefined reference - QNX 6.3.2 IDE 4.0.1  
Hello Steve,

Thank for the feedback.

Which of these libraries should I link as extra library
(...\QNX632\target\qnx6\shle\usr\lib):
libha.a
libham.a
libham.so
libham.so.2

When I include libha.a and libham.a, I get the error when starting debugging:
cannot find libham.so.2
When I include all lib-paths above, I get when compiling: cannot find -lham.so

Best wishes,
-- 
Dr.-Ing. Luciana Jatobá Großmann, MBA
Systems Engineering - Medizintechnik

ITK Engineering AG
Luitpoldstraße 59
D-76863 Herxheim

Tel.:  +49 7276 9885-680
Fax:   +49 7276 9885-619
Mobil: +49 176 21252623

mailto:luciana.grossmann@itk-engineering.de

_____________________________________________________________

ITK Engineering AG  Luitpoldstraße 59  76863 Herxheim, 
Tel.: +49 7276 9885-600   Fax: +49 7276 9885-619
mailto:info@itk-engineering.de   http://www.itk-engineering.de



Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Josef Würth
Vorstand/Executive Board: Michael Englert (Vorsitzender), Dr. Helmuth Stahl
Sitz der Gesellschaft/Registered Office: 76773 Kuhardt/Pfalz
Registergericht/Registered Court: Amtsgericht Landau, HRB 30139
USt.-ID-Nr./VAT-ID-No. DE 148497208
 

-----Ursprüngliche Nachricht-----
Von: Steve Reid [mailto:community-noreply@qnx.com] 
Gesendet: Montag, 31. Januar 2011 16:13
An: general-ide
Betreff: RE: HAM undefined reference - QNX 6.3.2 IDE 4.0.1

I think you need to link against libham. There's also a libha that some
functions live in.

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Lucian Grossmann [mailto:community-noreply@qnx.com]
> Sent: Monday, January 31, 2011 8:53 AM
> To: general-ide
> Subject: HAM undefined reference - QNX 6.3.2 IDE 4.0.1
> 
> I am trying to use the HAM. I have tried the following code from the 
> user guide:
> 
> #include "ha\ham.h"
> ...
> ham entity t *ehdl; /* The entity Handle */ int status;
> /*
> connects to a HAM with a heartbeat of 5 seconds and an entity name of 
> "client1", and no flags it also specifies hpdh = 4, and hpdh = 8 */ 
> ehdl = ham attach self("client1", 5000000000, 4, 8, 0); if (ehdl == 
> NULL) { printf("Could not attach to Ham\n"); exit(-1); }
> /* Detach from a HAM using the original handle */ status = 
> ham_detach_self(ehdl,0); ...
> 
> I am getting the following compiler errors:
> .c undefined reference to `ham_attach_self'
> .c undefined reference to `ham_detach_self'
> .o undefined reference to `ham_attach_self'
> .o undefined reference to `ham_detach_self'
> 
> What should I link? What am I missing?
> 
> Thank you in advance.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post82771
> 
> 



_______________________________________________

General
http://community.qnx.com/sf/go/post82777

RE: HAM undefined reference - QNX 6.3.2 IDE 4.0.1  
You shouldn't specify the .so extension when linking. The other command-line options will determine whether the linker 
looks for the .a or .so version.

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Lucian Grossmann [mailto:community-noreply@qnx.com] 
> Sent: Monday, January 31, 2011 10:33 AM
> To: general-ide
> Subject: AW: HAM undefined reference - QNX 6.3.2 IDE 4.0.1
> 
> Hello Steve,
> 
> Thank for the feedback.
> 
> Which of these libraries should I link as extra library
> (...\QNX632\target\qnx6\shle\usr\lib):
> libha.a
> libham.a
> libham.so
> libham.so.2
> 
> When I include libha.a and libham.a, I get the error when 
> starting debugging:
> cannot find libham.so.2
> When I include all lib-paths above, I get when compiling: 
> cannot find -lham.so
> 
> Best wishes,
> -- 
> Dr.-Ing. Luciana Jatobá Großmann, MBA
> Systems Engineering - Medizintechnik
> 
> ITK Engineering AG
> Luitpoldstraße 59
> D-76863 Herxheim
> 
> Tel.:  +49 7276 9885-680
> Fax:   +49 7276 9885-619
> Mobil: +49 176 21252623
> 
> mailto:luciana.grossmann@itk-engineering.de
> 
> _____________________________________________________________
> 
> ITK Engineering AG  Luitpoldstraße 59  76863 Herxheim, 
> Tel.: +49 7276 9885-600   Fax: +49 7276 9885-619
> mailto:info@itk-engineering.de   http://www.itk-engineering.de
> 
> 
> 
> Vorsitzender des Aufsichtsrats/Chairman of the Supervisory 
> Board: Josef Würth
> Vorstand/Executive Board: Michael Englert (Vorsitzender), Dr. 
> Helmuth Stahl
> Sitz der Gesellschaft/Registered Office: 76773 Kuhardt/Pfalz
> Registergericht/Registered Court: Amtsgericht Landau, HRB 30139
> USt.-ID-Nr./VAT-ID-No. DE 148497208
>  
> 
> -----Ursprüngliche Nachricht-----
> Von: Steve Reid [mailto:community-noreply@qnx.com] 
> Gesendet: Montag, 31. Januar 2011 16:13
> An: general-ide
> Betreff: RE: HAM undefined reference - QNX 6.3.2 IDE 4.0.1
> 
> I think you need to link against libham. There's also a libha 
> that some
> functions live in.
> 
> Steve Reid (stever@qnx.com)
> Technical Editor
> QNX Software Systems 
>  
> 
> > -----Original Message-----
> > From: Lucian Grossmann [mailto:community-noreply@qnx.com]
> > Sent: Monday, January 31, 2011 8:53 AM
> > To: general-ide
> > Subject: HAM undefined reference - QNX 6.3.2 IDE 4.0.1
> > 
> > I am trying to use the HAM. I have tried the following code 
> from the 
> > user guide:
> > 
> > #include "ha\ham.h"
> > ...
> > ham entity t *ehdl; /* The entity Handle */ int status;
> > /*
> > connects to a HAM with a heartbeat of 5 seconds and an 
> entity name of 
> > "client1", and no flags it also specifies hpdh = 4, and hpdh = 8 */ 
> > ehdl = ham attach self("client1", 5000000000, 4, 8, 0); if (ehdl == 
> > NULL) { printf("Could not attach to Ham\n"); exit(-1); }
> > /* Detach from a HAM using the original handle */ status = 
> > ham_detach_self(ehdl,0); ...
> > 
> > I am getting the following compiler errors:
> > .c undefined reference to `ham_attach_self'
> > .c undefined reference to `ham_detach_self'
> > .o undefined reference to `ham_attach_self'
> > .o undefined reference to `ham_detach_self'
> > 
> > What should I link? What am I missing?
> > 
> > Thank you in advance.
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 
> > General
> > http://community.qnx.com/sf/go/post82771
> > 
> > 
> 
> 
> 
>...