CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2001
    Posts
    1,029

    makefile for linux help needed.. any makefile people here? :)

    Hello,

    I made a library in Linux with a .h file test.h. So I have libtest.a which has a test.h file in it.

    I made a new makefile for a program I have:

    stupidprogram: $(OBJECTS)
    g++ -dy -o -l. -Ltest stupidprogram $(OBJECTS) $(LDLIBS)

    but when I try to make, I get an error indicating the .h file is missing?? ANy idea why it cant see it???

    Thanks!

  2. #2
    Join Date
    Apr 2001
    Posts
    1,029

    Re: makefile for linux help needed.. any makefile people here? :)

    I switched to:

    stupidprogram: $(OBJECTS)
    g++ -dy -o -L. -ltest stupidprogram $(OBJECTS) $(LDLIBS)

    but still doesnt work.. anyone help???

  3. #3
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557

    Re: makefile for linux help needed.. any makefile people here? :)

    lab1,

    What is the actual error? Is it an error from g++ or from GNU make?
    Where is the header located with respect to the C++ file? Are you sure that the include file is in your include path?
    Remember to fully specify your include path for g++ using the -I compiler directive.

    Give a bit of feedback please.

    Sincerely, Chris.
    You're gonna go blind staring into that box all day.

  4. #4
    Join Date
    Feb 2002
    Posts
    4,640

    Re: makefile for linux help needed.. any makefile people here? :)

    Do you have a tab character in front of the 'g++' line?

    Viggy

  5. #5
    Join Date
    Dec 2003
    Location
    Middletown, DE
    Posts
    67

    Re: makefile for linux help needed.. any makefile people here? :)

    Does the missing file error come from make or g++? If from make, then you have a rule somewhere that defines that header as a requisite for compiling the source file.

    Code:
    mysource.c: mysource.h other.h etc.h
    Otherwise, it could be as simple as the include path being wrong; -I parameter and not a make rule error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured