![]() |
|
#1
|
|||
|
|||
linker problemHi, I'm using g++ from eclipse. I'm trying to compile the following:
CPP / C++ / C Code:
The problem is that the linker cannot find the libraries: Code:
the libgnome-2 library really exists in /opt/gnome/lib with .a .la .so .so.0 and .so.0.601.0. They are owned by root and have rx permissions for others. What am I missing here. O, by the way, I'm using suse9.2 Last edited by LuciWiz : 15-Oct-2005 at 03:24.
Reason: Please insert your C++ code between [c++] & [/c++] tags
|
|
#2
|
|||
|
|||
Re: linker problemi'm no expert coder or heck i dont even pretend to know anything lol. But since nobody's posted anything i'll give my 2 cents.
I cant help you very much cause i'm not really sure what your trying to do but i know that most additional library's have to be added in the Linker Properties box. I'm not useing the same compiler as you but for me its under Project -> 'PROJECT NAME' Properties -> Linker -> General -> Additional Library Directories maybe that will help you find the problem. again i could be way off sorry if i am. __________________
There are 10 kinds of people in this world. Those who speak binary and those who dont. |
|
#3
|
||||
|
||||
Re: linker problemQuote:
I don't have suse or eclipse to test the results, but I'll take a wild stab at it. I will point out that the legacy of C compiler/linkers command line usage is kind of strange. For example, if the library name is libm.a, the command line to include this would be something like Quote:
If you have a library named libiberty.a, you would use Quote:
See the pattern? So, if your library is named libgnome-2.a, your command line wouldn't have "llibgnome-2", it would have this: Quote:
Let us know if it makes a difference. Note that if you are sure that the library name is OK, you can make sure that the tools get to the right directories by using "-v" in the command line for gcc. The "verbose" output of the compiler tells us where it is looking. Regards, Dave Last edited by davekw7x : 14-Oct-2005 at 16:01.
|
|
#4
|
|||
|
|||
Re: linker problemThanks Dave that did the trick. Returning to c/c++ after 8 years of java ;-)
So, as a rule, libs named libxyz are 'known' to the linker as xyz. Sven |
|
#5
|
|||
|
|||
Re: linker problemQuote:
This is in keeping with the traditional UNIX philosophy of minimizing keystrokes, especially on command lines. You know, "cp" for copy, "rm" for remove, "mv" for move, etc., so "gcc -lm z.c" to link in libm.a Note that while developing and testing, I usually name my programs z.c (even in Windows) instead something like "theBigTestProgramForSocketsProgramming.c", so you can see that I have bought into it. Regards, Dave |
|
#6
|
|||
|
|||
Re: linker problemQuote:
I guess I've used Eclipse too much to really remember that I guess however that my boss prefers "TheReallyReallyLongNameForTheApplicationHeSoldThe Client" instead of just "z" I must say I Like the "z" though |
|
#7
|
|||
|
|||
Re: linker problemQuote:
That's what Makefiles are for. Enter the stuff once, then just enter make. (Or if you are really lazy, put alias 'm=make' in your ~/.bashrc, then you only enter m.) Regards, Dave |
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphic problem in Unreal Tournament 2004 | zerox | Computer Software Forum - Games | 10 | 09-Oct-2005 12:31 |
| Runtime Problem involving "printf" in C Program | supamakia | C Programming Language | 2 | 09-Oct-2005 10:09 |
| a significant problem after installing Xp | mohammad | Computer Software Forum - Windows | 10 | 09-Aug-2005 07:03 |
| Another FX 5600 problem (but with details that might shed light on this) | BobDaDuck | Computer Hardware Forum | 2 | 16-Apr-2004 07:53 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The