|
From: | John Calcote |
Subject: | Re: Trouble linking through g++ |
Date: | Thu, 15 Oct 2009 10:44:09 -0600 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4 |
Hi Madhav, On 10/15/2009 8:03 AM, Madhav Ancha wrote: Hi, A makefile contains rules and command (and other things). Rules are lists of targets, followed by separator (colon, double-colon, etc), followed by lists of dependencies. Commands are lines prefixed with a TAB character. In your rule, you have a linker option (-lSharedLib) in your dependency list. The target list and the dependency list must only contain file names, or macros that resolve to file names, or patterns (containing '%' or '*' characters) that can match file names. You can't put anything else into either the target or dependency list. What you probably wanted to write was this (untested): LINK_FLAGS= -g -pg -fprofile-arcs -ftest-coverage -fPIC -Lrelease1
testApp: file.o
$(CXX) $(LINK_FLAGS) -o $@ file.o -lSharedLib
Note that I changed $^ to file.o in the command line because $^ is not portable between various flavors of make. John |
[Prev in Thread] | Current Thread | [Next in Thread] |