freeipmi-devel@ CC'ed.

* Sharad Chandra <[EMAIL PROTECTED]> [14.12.2006 17:16]:

[...]
>       Yes you r right. I am using Freebsd. The code you provide is working 
> only 
> when it is .c file. and i was using .cc file and compiling with g++
> 
> 
> #include <stdio.h>
> #include <freeipmi/udm/ipmi-udm.h>
> 
> int
> main(void)
> {
>                 ipmi_open_inband(IPMI_DEVICE_KCS, 0, 0, 0, NULL, 0);
>                         return (0);
> }
> 
> [EMAIL PROTECTED] g++ -I /usr/local/include/ -L /usr/local/lib -lfreeipmi 
> health.cc
> /var/tmp//ccWYJUfo.o(.text+0x25): In function `main':
> : undefined reference to `ipmi_open_inband(ipmi_driver_type, int, unsigned 
> short, unsigned char, char*, unsigned int)'
> 
> but if i do .. 
> mv health.cc health.c                 <--'
> gcc -I /usr/local/include/ -L /usr/local/lib -lfreeipmi health.c              
>         <--'
> 
> No problem in code..
> why is it not compiling with g++??

It seems, that definition of ipmi_open_inband() is not protected from
C++ symbol versioning, unlike definitions in most other includes. You
can workaround this e.g. by wrapping freeipmi includes in protection
block in your C++ code:

extern "C" {
#include <freeipmi/udm/ipmi-udm.h>
}

The better way is to encourage developers to fix that difference ;)

    wbr&w, dmitry.
-- 
Dmitry Frolov <[EMAIL PROTECTED]>
RISS-Telecom Network, Novosibirsk, Russia
[EMAIL PROTECTED], +7 383 2278800, DVF-RIPE


_______________________________________________
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel

Reply via email to