Unix Technical Forum

.so problem

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) ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 06:30 AM
news oleane
 
Posts: n/a
Default .so problem

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...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 06:30 AM
Paul Pluzhnikov
 
Posts: n/a
Default Re: .so problem

"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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 06:30 AM
news oleane
 
Posts: n/a
Default Re: .so problem

Hi and thanx but...
It doesn't work

Always this fu**** message

I don't understand


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 06:31 AM
Gary R. Hook
 
Posts: n/a
Default Re: .so problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 06:31 AM
news oleane
 
Posts: n/a
Default Re: .so problem

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...





Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-05-2008, 06:31 AM
Gary R. Hook
 
Posts: n/a
Default Re: .so problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-05-2008, 06:31 AM
stef
 
Posts: n/a
Default Re: .so problem

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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-05-2008, 06:31 AM
Uli Link
 
Posts: n/a
Default Re: .so problem

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-05-2008, 06:31 AM
James T. Sprinkle
 
Posts: n/a
Default Re: .so problem

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...
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 01-05-2008, 06:31 AM
Timothy J. Bogart
 
Posts: n/a
Default Re: .so problem

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com