LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   【how to link to static libs when calling cmake or autoconf】 (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-link-to-static-libs-when-calling-cmake-or-autoconf-929114/)

zcnnbb 02-13-2012 09:45 AM

【how to link to static libs when calling cmake or autoconf】
 
suggest i have the source code of an application, which depends on packages A and B.
I want the program statically link to libA.a and dynamically link to libB.so.
What extra parameter should I specify when calling cmake or ./configure?

mulyadi.santosa 03-08-2012 12:17 PM

Hi...

Just dumb idea, I think you need to use gcc -static to statically link to libA. How about libB? You need to directly use dlopen() for that. So it won't be linked at compile time but use at runtime.

Hope it helps... :)


All times are GMT -5. The time now is 10:34 PM.