CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2006
    Posts
    141

    A simple question about writing a Makefile

    I have main.cc and test.h files,
    main.cc includes test.h

    Here is the Makefile, but it doesn't work. any clue?


    Code:
    main : main.o                                                                                                                                                                
            g++ -g main.o -o main                                                                                                                                                
    main.o : main.cc test.h                                                                                                                                                      
            g++ -o main.o -c -g test.h main.cc

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

    Re: A simple question about writing a Makefile

    Define "doesn't work".

    Viggy

  3. #3
    Join Date
    Jun 2005
    Posts
    1,255

    Smile Re: A simple question about writing a Makefile

    A common mistake is the use of spaces instead of a tab character at the beginning of a command line. I don't know if this is the case, here.

    See http://www.gnu.org/software/make/manual/make.html

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