Results 1 to 2 of 2
Hi All,
I have more than one libraries to link and generate an executable.
But, whenever i try to link the library by
g++ -L../../ main.cpp -lxp.a -lap.a ...
I ...
- 10-10-2008 #1Just Joined!
- Join Date
- Jan 2008
- Posts
- 9
Order of Linking Libraries
Hi All,
I have more than one libraries to link and generate an executable.
But, whenever i try to link the library by
g++ -L../../ main.cpp -lxp.a -lap.a ...
I get lot of undefined references to functions. All I want know is whether there is any order of linking so that we should maintain that order when linking libraries.
Can any one please help me to resolve this problem
Thanks & Regards
Vikram
- 10-10-2008 #2
Should the code you are compiling (main.cpp) not go at the end of the command so that it can pick up the functions in the libraries?
Registered Linux user #388328 || Registered LFS user #15880
AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
Need instant help? Try us on IRC -- #linuxforums on freenode


Reply With Quote