Linking to libsmbclient.so

Steven McClellan steve at mcclellan.org
Thu Mar 11 12:46:46 GMT 2004


Hello,

I am trying to compile a test program and link to the libsmbclient.so shared
library and ld is producing an error:

[steve at localhost steve]$ gcc testsmbc.cc
/usr/local/samba/lib/libsmbclient.so -o testsmbc
/tmp/cczi0mto.o(.text+0x1f3): In function `main':
: undefined reference to `smbc_init(void (*)(char const*, char const*,
char*, int, char*, int, char*, int), int)'
/tmp/cczi0mto.o(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status

This test program only makes reference to one function for simplicity in
troubleshooting - smbc_init, and the code has been taken directly from the
libsmbclient example of testsmbc.  The only change is that I have changed
the extension of the source file from .c to .cc.  If I change it back to .c
then it compiles and links just fine, but with the .cc extension it doesn't
link.

I suspect C++ name mangling but I just don't know what is going on.  Since
all of my other source code for the project is .cc and I really can't change
it - I am just trying to add samba capability to it

So, is there any way to be able to link to the libsmbclient.so from C++?

-Steve



More information about the samba-technical mailing list