![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reference: WebObjects 5.4.1 Reference | iBot | UNIX and Linux RSS News | 0 | 03-11-2008 09:50 PM |
| undefined reference to `pthread_create' | netman | High Level Programming | 2 | 01-28-2008 12:31 PM |
| about undefined reference for 'sinf' | bharat suthar | High Level Programming | 2 | 05-13-2006 08:45 PM |
| Undefined reference to Error | svh | High Level Programming | 2 | 02-11-2006 12:23 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
I just link 3rd part archive file (xerces-c.a) to make my own program.
the error looks like: ./lib_2_8_64bit/libxerces-c.a(XMLString.o): In function `xercesc_2_8::XMLString::trim(char*)': XMLString.cpp(.text+0xa85): undefined reference to `__ctype_b' XMLString.cpp(.text+0xab0): undefined reference to `__ctype_b' collect2: ld returned 1 exit status make: *** [all] Error 1 however, if i link shared library (xerces-c.so) instead of .a file, then it compiles. so any tips or tricks when linking the static library? |
|
||||
|
The .a file may still have external symbols that are resolved in the shared library.
Are you trying a static link? Code:
nm xerces-c.a | grep ctype_b |
|
||||
|
Another thought - you may not be aware that the order of libraries linked against is important. Try moving the .a file to the first element in the -l list.
Also, you may need to put something like the std c++ library as the last in that list - in other words some standard shared libraries may need to be parsed for symbols more than once. What is happening: the .a file is introducing symbols that were not in the original object file, these extern symbols were probably available earlier, but ld skipped over them because they were not needed at that time. |
![]() |
| Bookmarks |
| Tags |
| awk, awk trim, trim, trim awk |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|