I have 2 versions of ld in my machine.
Suppose I want to specify /usr/bin/ld as the linker to make a binary. How should I write the Makefile?
Thanks.
I have 2 versions of ld in my machine.
Suppose I want to specify /usr/bin/ld as the linker to make a binary. How should I write the Makefile?
Thanks.
Here is the Makefile
Seems no where to indicate "ld" ?Code:main : main.o g++ main.o main.o : main.cc g++ -c main.cc
I would set your PATH so that the ld you want is found first, unless you plan to switch back and forth a lot (why you would I don't know).
There isn't any way to specify which "ld" to use on the gcc command line.
There are some things you can use for gcc to tell it where things are:
1. the -B switch, which tells gcc the base directory to use for the subcomponents.
2. -specs=FILE to give gcc a new "specs" file. Although I'm not sure if this actually allows you to specify the path of the linker, it's where I think it COULD be done. Syntax is definitely not straight forward!
Edit: To clarify: The solution by Tabstop is probably the right way to do it.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.