help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gmake error: No rule to make target lib_file.a


From: Dave Seaman
Subject: Re: gmake error: No rule to make target lib_file.a
Date: Thu, 8 May 2008 13:58:59 +0000 (UTC)
User-agent: slrn/0.9.8.1 (Darwin)

On Thu, 8 May 2008 05:18:03 -0700 (PDT), D3|\||\|!$ wrote:


> Dave Seaman wrote:
>> On Wed, 7 May 2008 05:53:45 -0700 (PDT), D3|\||\|!$ wrote:

>> > I supplied the libraryname along with the path as "dir_pathname/
>> > libfilename1.a dir_pathname/libfilename2.a.." in the make options.
>> > Gmake shows success but does not create the corresponding .o and
>> > binary files.

>> A library is an archive.  Did you provide any dependencies involving
>> members of the archive?  You may want to look at:

>>      <http://www.gnu.org/software/make/manual/make.html#Archives>

>> > When I hit execute, it throws up a terminal window saying "./
>> > project_dir does not exist".

>> What does it mean to "hit execute"?  I thought you were using "make".
>> What happens if you execute the program in the same terminal window that
>> you were using to run make?  What is your current working directory?
>> Does project_dir actually exist, and is it a subdirectory of your current
>> working directory, as the command expects?

>> > Another thing: though gmake shows success, it gives the following
>> > message for all the included libraries - "Nothing to do for
>> > libfilename.a"

>> That means that all the library members you specified as dependencies in
>> your Makefile for the given target are already up to date.  Note that
>> this is vacuously true if you failed to provide any such dependencies.

> Sorry but I am not very clear about the dependency thing you are
> talking about - I'm more used to being a "Windows-GUI Kiddie" and
> mentioning the libraries used by the application source into some kind
> of space and leaving the rest to the IDE... Any help will be really
> appreciated!! Where exactly am I expected to provide such a
> dependency?

You provide dependencies in the Makefile.  That's what it's for.  The
entries there mostly specify dependencies and rules for bringing a target
up to date.  For example, if your Makefile has

foo.o:          foo.c
        ${CC} ${CFLAGS} -c $< -o $@

that means that foo.o depends on foo.c, and if foo.c is newer than foo.o
(or if foo.o does not exist), then the rule that is provided on the next
line is used to bring foo.o up to date.

>> See the URL above to find out how to do this.  The short description is
>> that you can use "libfoo.a(bar.o)" in a dependency rule to specify a
>> library member to be updated.  You can use "ar t <library-file>" to see
>> what members, if any, the library already has.  If the ones you need are
>> not there, then you need some more rules in your Makefile to create them.

>> > Also, if I remove all the linker flags and stuff, gmake still shows
>> > the same success message... Is that OK??

>> If you expected something to be created and it wasn't, then something is
>> missing in your make rules.

> Well!! When one "builds" a project, one does expect to find the .o
> files of the .cpps and the binary of the .cpp file containing the
> main() function. This is not there... I have already uploade d the
> makefile but the solution you suggested ealier doesn't seem to fit
> into the solution.. :-(

What messages do you get when you run the "make"?  Most likely, the first
error message is the important one, not the last one.

Was the Makefile intended to work in a Windows environment, or does it
assume a Unix/Linux platform?  In the latter case, there may be no easy
solution.  


-- 
Dave Seaman
Third Circuit ignores precedent in Mumia Abu-Jamal ruling.
<http://www.indybay.org/newsitems/2008/03/29/18489281.php>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]