Joined: 14 Jun 2007 Posts: 409 Location: Falun, WI USA
Posted: Thu May 15, 2008 4:54 pm Post subject: multiple static libraries
Hi,
maybe I'm just having a brain lapse, but this is really getting to me, so I figured I'd ask for help.
I have two static libraries (libncString, libncUI), libncUI calls functions from libncString.
In my testing program, if I call a function in libncUI that depends on libncString, it will give undefined reference errors, but if I call an ncString function somewhere in my test program, it compiles and runs just fine.
examples:
Code: (C)
1 2 3
/* this one fails to link */
/* nc_menu_add_menu() calls nc_strip_char(), which is in libncString */
nc_menu_add_menu(&NC_MENUBAR(mbar)->mdat, "/", "File");
Code: (C)
1 2 3
/* this one links and runs fine */
nc_strip_char("test", 't');
nc_menu_add_menu(&NC_MENUBAR(mbar)->mdat, "/", "File");
if I'm missing something, I'd really appreciate some help.
Thanks...
Joined: 14 Jun 2007 Posts: 409 Location: Falun, WI USA
Posted: Thu May 15, 2008 7:05 pm Post subject:
okay, it turns out it was just an error in my link command (-lncString wasn't in the spot it should have been).
however, I'm still curious as to why it compiles fine if I have a call to an ncString function in my test program.
Thanks...
Last edited by dreblen on Thu May 15, 2008 7:16 pm; edited 1 time in total