Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
90 user(s) are online (66 user(s) are browsing Forums)

Members: 0
Guests: 90

more...

Headlines

 
  Register To Post  

How to link with a .so library?
Just can't stay away
Just can't stay away


See User information
How do I link with .so libraries using gcc?

I'm trying to link my project to libpng12.so and libfreetype.so. The linking call looks like this:

c++ -o testapp $(OBJECTS) -L/work/CODE/large/qt-x11-opensource-src-4.5.3/lib -lQtGui -lQtCore -Lcygnix:cygnixppc/x11r6.3/lib -lXt -lSM -lICE -lXext -lX11 -laos4util-newlib -LSDK:gcc/lib/gcc/pcc-amigaos/4.2.4/newlib/lib -LSDK:newlib/lib -lunix -lauto -LSDK:local/newlib/lib -lpng12 -lfreetype

but c++ returns "can't find -lpng12". I've tried also replacing the last three parameters with:

SDK:newlib/lib/libpng12.so SDK:newlib/lib/libfreetype.so

but c++ returns an error again claiming, that I'm trying to link staticly to a dynamic library.

What am I doing wrong?

Go to top
Re: How to link with a .so library?
Just popping in
Just popping in


See User information
@alfkil

You need to add -use-dynld to your gcc switches chain. Also, follow this simple guide on utilitybase.com to avoid problems when compiling with .so, it is very helpful: http://utilitybase.com/article/show/2 ... 263/Shared+objects+on+OS4

Varthall

Go to top
Re: How to link with a .so library?
Just can't stay away
Just can't stay away


See User information
@Varthall

Thanks! It seems to work now...

Go to top
Re: How to link with a .so library?
Not too shy to talk
Not too shy to talk


See User information
@alfkil

So nice ! It seems that my article is helpful :)

You can check your final executable with :
readelf -d testapp

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project