The libsmbclient.h doesn't contain extern "C" wrapper(s) around function prototypes and consequently doesn't allow C++ program to link to libsmbclient.so shared library. Consequently a #ifdef __cplusplus extern "C" { #endif int smbc_init(smbc_get_auth_data_fn fn, int debug); #ifdef __cplusplus } #endif must be added in order to make it work for C++.
Can't you add the extern "C" bit around the #include instead?
add cc
Steve, please make sure to include responses in bugzilla rather than responding to the email notifications directly. Thanks. --jerry > Yes, but most libraries that I have been using > from various sources have them in the header, so at > least this should be considered, or perhaps a > documentation change for the libsmbclient examples > would be in order.
OK, perhaps I should add these to the include file.
OK, I think I have done the right thing here. Revision 599. Can someone check that it is correct?
the #ifdef __cplusplus extern "C" { #endif is only necessary on top of the file, not before every function
Changed to include only one C++ guard. I think this can be closed now!
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.