Linking with LD and not G++ (Mingw)

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Linking with LD and not G++ (Mingw)

Post by ionstream »

This is incredibly annoying, but I can't link anything I make using ld, I get many many errors. I can compile the samples (using the makefiles), and I noticed that the makefile uses g++ to like the .o file to the libraries. This is incredibly frustrating, and I am trying not to explode in rage... all I want to do is make a simple freaking program!!! :cry:.

Why do the samples use G++ to link, when LD was specifically created for linkage??? Is there any way to get LD to work, or do I have to abandon Code::Blocks (since it uses LD)?


Please, if you have an mercy in your soul, please help me!
leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio »

It uses ld in the process... You can even pass options to ld with the -Wl option, e.g -Wl,-rpath,/path/to/dir
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Post by ionstream »

Ah never mind, my libraries were wrong, and Code::Blocks uses g++ for linkage.


But I have one more question, does it matter what order the program links to the libraries?
mandrav
Earned a small fee
Earned a small fee
Posts: 11
Joined: Wed Jan 05, 2005 7:43 am

Post by mandrav »

ionstream wrote:Ah never mind, my libraries were wrong, and Code::Blocks uses g++ for linkage.
That's just what I was about to reply ;)
ionstream wrote:But I have one more question, does it matter what order the program links to the libraries?
Absolutely. Libraries on which other libraries depend on, should be first (I hope this makes sense).

Yiannis.
number4
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Mar 09, 2005 6:12 pm

Post by number4 »

Libraries on which other libraries depend on, should be first (I hope this makes sense).
people always say that, but is't it actually they should be last? IDE's however tend to display them in different ways.
Post Reply