$ cat test.c #include <libsmbclient.h> int main() { char *c; char *s; int l; return smbc_urlencode(c, s, l); } $ gcc test.c -Wall -I/opt/local/include -L/opt/local/lib/samba3 -lsmbclient Undefined symbols: "_smbc_urlencode", referenced from: _main in ccdxnKVA.o ld: symbol(s) not found collect2: ld returned 1 exit status $ gcc test.c -Wall -I/opt/local/include -E | grep -C3 smbc_urlencode smbc_urldecode(char *dest, char * src, size_t max_dest_len); # 2542 "/opt/local/include/libsmbclient.h" 3 int smbc_urlencode(char * dest, char * src, int max_dest_len); # 2558 "/opt/local/include/libsmbclient.h" 3 const char * smbc_version(void); -- int main() { char *c; char *s; int l; return smbc_urlencode(c, s, l); }
This seems to have been a fallout of: http://gitweb.samba.org/?p=samba.git;a=commit;h=59292c0da8880afd7bac82f6a5bba009f3827ea0
Thanks. The bug is actually that there's still an external declaration for that symbol in libsmbclient.h. It's not exported because since the revamp, it hasn't been a public function and has a different name now, internally. I can solve this bug in either of two ways: remove the declaration from libsmbclient.h, or make the function public. My preference is the former, as libsmbclient isn't intended as a utility library. I'm willing to be convinced that there's ample use for the function that I should just export it, however. Derrell
I discovered this while compiling XBMC which uses smbc_urlencode() (line 267 at http://xbmc.org/trac/browser/branches/linuxport/XBMC/xbmc/FileSystem/FileSmb.cpp ) As a workaround, I just patched our samba to provide those symbols: http://trac.macports.org/browser/trunk/dports/net/samba3/files/urlencode.compat.patch http://trac.macports.org/browser/trunk/dports/net/samba3/files/urlencode.compat.patch?format=txt I think it would be less headache if you provided these symbols but marked them as deprecated, so people will see the warning during compilation
Exported in all branches