LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-28-2004, 05:58 AM   #1
stpg
LQ Newbie
 
Registered: Jun 2004
Distribution: Fedora Core 2
Posts: 11

Rep: Reputation: 0
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
 
Old 06-28-2004, 03:34 PM   #2
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Try linking explicitly to the static libs...

eg.
gcc foo.c /usr/lib/libbar.a -lshared_lib
 
Old 06-29-2004, 03:58 AM   #3
stpg
LQ Newbie
 
Registered: Jun 2004
Distribution: Fedora Core 2
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 06-29-2004, 04:48 AM   #4
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
you sound like you wanted everything dynamically linked. so what's wrong with using just -lbar -lbarbar?
 
Old 06-29-2004, 05:20 AM   #5
stpg
LQ Newbie
 
Registered: Jun 2004
Distribution: Fedora Core 2
Posts: 11

Original Poster
Rep: Reputation: 0
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 ???
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shared to static library ofada Programming 2 07-08-2009 12:54 PM
library linked twice okhan Programming 1 08-12-2005 11:33 PM
static linking to c library lantern Programming 1 04-19-2004 09:58 AM
How to use own static library? chuanyung Programming 4 03-10-2004 08:54 PM
NEWBIE : Please how to distribute a shared or static library with a rpm simus Linux - General 0 02-18-2004 11:31 AM


All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration