This is a discussion on .so problem within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hello guys... I need your help once again on "old" AIX4.1... I'm using libxml2.so.a (downloaded from UCLA domain libray) ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello guys... I need your help once again on "old" AIX4.1... I'm using libxml2.so.a (downloaded from UCLA domain libray) with a little/simple program. Each time I'm compiling, I get : Symbol vsnprintf in /usr/lib/libxml2.so.a is undefined Symbol snprintf in /usr/lib/libxml2.so.a is undefined So, I've done an extend.so.a (with -bexpall) which contains sources of vsnprintf() and snprintf(). I merge it with my program like : $ cc test.c -lextend.so -lxml2.so -L.... Compilation is ok but when I run the program I still caught with the same problem : vsnprintf/snprintf undefined symbol error !? Could you help me please ?? Thanx... |
| |||
| "news oleane" <stef.pellegrino@gmail.com> writes: > I merge it with my program like : > $ cc test.c -lextend.so -lxml2.so -L.... That's backwards. Try this instead: cc test.c -L.... -lxml2.so -lextend.so ... If that works, and you want to understand why, you may want to read this: http://webpages.charter.net/ppluzhnikov/linker.html Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. |
| |||
| news oleane wrote: > I'm using libxml2.so.a (downloaded from UCLA domain libray) with a > little/simple program. > Each time I'm compiling, I get : > Symbol vsnprintf in /usr/lib/libxml2.so.a is undefined > Symbol snprintf in /usr/lib/libxml2.so.a is undefined Hmm.... I just checked UCLA's SEAS site, and I'm only finding a libxml.a. In the 4.1 version, that archive contains only static object files. So the question is, where'd you get a ..so, and how was it built? And are you referring to a compile/link error, or a runtime error? There's a huge difference... > So, I've done an extend.so.a (with -bexpall) which contains sources of > vsnprintf() and snprintf(). AIX provides implementations of those two functions in libc.a. Why are you trying to provide your own version? -- Gary R. Hook __________________________________________________ ______________________ Vocatus atque non vocatus deus aderit |
| |||
| Hello, > Hmm.... I just checked UCLA's SEAS site, and I'm only finding > a libxml.a. In the 4.1 version, that archive contains only > static object files. So the question is, where'd you get a > .so, and how was it built? Sorry, my fault, it was libxml2 for 4.2 version > And are you referring to a compile/link error, or a runtime > error? There's a huge difference... As the library is loaded dynamicaly, the compiler send me a warning... then then linker cry that it cannot find the functions > AIX provides implementations of those two functions in libc.a. Why > are you trying to provide your own version? My libc.a doesn't have these 2 functions !? (and I can't see their exports in libc.a) but it's an old AIX thanx... |
| |||
| news oleane wrote: >>Hmm.... I just checked UCLA's SEAS site, and I'm only finding >>a libxml.a. In the 4.1 version, that archive contains only >>static object files. So the question is, where'd you get a >>.so, and how was it built? > > Sorry, my fault, it was libxml2 for 4.2 version Again, same point: there is no libxml2.so.a in the UCLA distribution for any level of AIX. I just downloaded 2.6.16 and looked. No got. So the question remains, where did your copy come from? >>And are you referring to a compile/link error, or a runtime >>error? There's a huge difference... > > As the library is loaded dynamicaly, the compiler send me a warning... > then then linker cry that it cannot find the functions A dynamic reference to a shared module can exist at exec time, but that doesn't make the module "loaded dynamicaly". It may be best to copy/paste the _exact_ messages you're getting, because the precise problem is still not clear. >>AIX provides implementations of those two functions in libc.a. Why >>are you trying to provide your own version? > > My libc.a doesn't have these 2 functions !? > (and I can't see their exports in libc.a) OK, impossible. Run "nm -pBC /usr/lib/libc.a | grep nprintf" to see if there are any definitions. Exports are viewed via dump -Tv /usr/lib/libc.a. Also note that libc.a on AIX contains both dynamic and static object files. You might find it useful to read http://www-106.ibm.com/developerwork...dfs/aix_ll.pdf > but it's an old AIX Doesn't matter. None of this has changed much over the years. -- Gary R. Hook __________________________________________________ ______________________ Vocatus atque non vocatus deus aderit |
| |||
| Ok man, You care about that, but if you want : http://aixpdslib.seas.ucla.edu/aixpdslib.html sorry to say that but : nm -pBC /usr/lib/libc.a | grep nprintf returns nothing ! and libxml2.6.16.a with "ar" contains libxml2.so.2 if I try ldd on this libxml2.so.2, it's a shared lib ! anyway, Now if I compile my own version of vsnprintf() and link-it everything work... sorry again > Doesn't matter. None of this has changed much over the years. Sometimes things change... sorry |
| |||
| news oleane schrieb: > Hello guys... > > I need your help once again on "old" AIX4.1... > > > > I'm using libxml2.so.a Runtime dynamic linking was first introduced in AIX 4.2 The Linker of AIX 4.1 does *not* resolve into *.so Building shared libs on AIX 3 and 4.1 is a little tricky, and all external symbols must be resolved at load time of the program. No late binding. So a shared lib libfoo.a is created from the object shr.o (or you can call it libfoo.so if you want) with "ar -rv libfoo.a shr.o" And then you link with -lfoo libfoo.a can contain more than one object. The command "dump -T yourproggie" list all objects and from which archives they are loaded. -- Uli |
| |||
| Which C compiler are you using? JaYmZ "news oleane" <stef.pellegrino@gmail.com> wrote in message news:d6cpoc$2vj$1@s1.news.oleane.net... > Hello guys... > > I need your help once again on "old" AIX4.1... > > > > I'm using libxml2.so.a (downloaded from UCLA domain libray) with a > little/simple program. > Each time I'm compiling, I get : > Symbol vsnprintf in /usr/lib/libxml2.so.a is undefined > Symbol snprintf in /usr/lib/libxml2.so.a is undefined > > > So, I've done an extend.so.a (with -bexpall) which contains sources of > vsnprintf() and snprintf(). > I merge it with my program like : > $ cc test.c -lextend.so -lxml2.so -L.... > > > Compilation is ok but when I run the program I still caught with the same > problem : > vsnprintf/snprintf undefined symbol error !? > > > > > Could you help me please ?? > > > Thanx... > > |
| ||||
| Uli Link wrote: > news oleane schrieb: > >> Hello guys... >> >> I need your help once again on "old" AIX4.1... >> >> >> >> I'm using libxml2.so.a > > Runtime dynamic linking was first introduced in AIX 4.2 > The Linker of AIX 4.1 does *not* resolve into *.so > > Building shared libs on AIX 3 and 4.1 is a little tricky, and all > external symbols must be resolved at load time of the program. No late > binding. > > So a shared lib libfoo.a is created from the object shr.o (or you can > call it libfoo.so if you want) with "ar -rv libfoo.a shr.o" > And then you link with -lfoo > libfoo.a can contain more than one object. > > The command "dump -T yourproggie" list all objects and from which > archives they are loaded. > Umm, do I have to re-look up history here? Can't remember on AIX1, never used AIX2, but AIX 3 and later were all shared library based. They didn't (and largely don't today) use the nomenclature of .so. When the symbol resolution is done should not be confused with where the symbol information is gathered. Cheers. |