[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freeipmi-devel] Re: [Freeipmi-users] ipmi_open_inband
From: |
Dmitry Frolov |
Subject: |
[Freeipmi-devel] Re: [Freeipmi-users] ipmi_open_inband |
Date: |
Thu, 14 Dec 2006 17:53:36 +0600 |
User-agent: |
Mutt/1.5.11 |
freeipmi-devel@ CC'ed.
* Sharad Chandra <address@hidden> [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);
> }
>
> address@hidden 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 <address@hidden>
RISS-Telecom Network, Novosibirsk, Russia
address@hidden, +7 383 2278800, DVF-RIPE