LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   howto compile bin with my library using all-static and shared linked standart library (http://www.linuxquestions.org/questions/programming-9/howto-compile-bin-with-my-library-using-all-static-and-shared-linked-standart-library-198594/)

stpg 06-28-2004 04:58 AM

howto compile bin with my library using all-static and shared linked standart library
 
hi.
i start coding for linux about month ago. and i have one problem:
i create project with main binnary and several libraries. i use -all-static to link binnary with libraries to one big binnary. but i have to add some external libraries (GL,GLU,X11) to work with x11 and opengl. kdevelop don't want to compile my project any more (there was many 'unresolved external')
Ok then i turn -all-static off - and project was successfully compiled but all my libraries become dynamic too and i dont want it.

Any suggestions how to build-in my libraries and use dynamic standart libraries

ugenn 06-28-2004 02:34 PM

Try linking explicitly to the static libs...

eg.
gcc foo.c /usr/lib/libbar.a -lshared_lib

stpg 06-29-2004 02:58 AM

re
 
i cannot use libbar.a becouse i need libbar.so and libbarbar.so
and libbar.so use libbarbar.so , also libbarbar.so use libbar.so
so they must be dynamicly linked .so, but not .a

ugenn 06-29-2004 03:48 AM

you sound like you wanted everything dynamically linked. so what's wrong with using just -lbar -lbarbar?

stpg 06-29-2004 04:20 AM

re
 
i want what my project will be consist of several modules (they lies in different folders) while i develop it (it make easyer to work in team) but also i want to have one single binnary
i tried to use simple library (.a) but i have one sevetral libraries with cross-referencies so i decided to use .so with -all-static key
i am new to kdevelop and maybe there is another way to do it.
Do you know how to separete code in different dirrectory in kdevelop?
i saw only one - in automake manager create subprojects and library targets in them ???


All times are GMT -5. The time now is 04:46 PM.