Results 1 to 1 of 1
Hello, I have the following issue: I have a Makefile that has an objects variable that is a list of .o files. My main goal in the Makefile looks like ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-02-2010 #1
- Join Date
- May 2010
Linking woes with g++
Hello, I have the following issue:
I have a Makefile that has an objects variable that is a list of .o files. My main goal in the Makefile looks like the following:
g++ -o myexecutable $(objects)
The trouble is that all the object files are in an obj directory that is a direct child of the directory this Makefile is in. I have added the obj directory to the VPATH variable and make has no problem finding the files. g++ However says that it can not find the object files listed.
So far I have not found any information on how to convince g++ or ld to search a directory for object files listed like above. There is information on the -L and -l options however I am not using them here and adding them has no effect. Is there any way to make g++/ld search a specific directory for object files that are simply added at the end of the command line?
P.S. I skimmed over the make, ld and gcc man pages as well as the manuals on the gnu web site and could not find an answer.
Any help would be appreciated.