Thread: makefile

  1. #1
    Musicman - Canora
    Join Date
    Aug 2005
    Location
    Melbourne
    Posts
    252

    makefile

    Hey guys my make file is sorta working but i dont think its actually compiling properly could someone double check it because when i try compile this i get an error

    Code:
    int main(int argc, char *argv[])
    
    if(argc==3 && !strcmp(argv[1], "menu"))
       {
         printf("Cannot find filename wrongly entered\n");
         return ERRORCODE;
       }


    Code:
    all: gjc.o gjc_utility.o gjc_options.o
    	gcc -gstabs -o gjc gjc.o gjc_utility.o gjc_options.o
    	
    gjc.o: gjc.c gjc.h
    	gcc -gstabs -Wall -ansi -pedantic -c gjc.c
    	
    gjc_options.o: gjc_options.c gjc_options.h
    	gcc -gstabs -Wall -ansi -pedantic -c gjc_options.c
    	
    gjc_utility.o: gjc_utility.c gjc_utility.h
    	gcc -gstabs -Wall -ansi -pedantic -c gjc_utility.c
    	
    clean:
    	rm gjc gjc.o gjc_options.o gjc_utility.o

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    95
    What is the error you get ?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > when i try compile this i get an error
    1. You don't post the error

    2. Your program snippet doesn't even compile.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Musicman - Canora
    Join Date
    Aug 2005
    Location
    Melbourne
    Posts
    252
    i get a type cast error from pointer to integer

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Why is it so bloody difficult for you to post the code?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Maybe you need to include <string.h>?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > int main(int argc, char *argv[])

    > if(argc==3 && !strcmp(argv[1], "menu"))
    It's painfully obvious from this post that the OP is a lying ........, because he's posted two lines of code from TWO different functions.

    How the hell does he expect to get a meaningful answer from such vague information?

    I'm beginning to think bazzano is a time-wasting troll.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  8. #8
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    Quote Originally Posted by bazzano
    Hey guys my make file is sorta working but i dont think its actually compiling properly could someone double check it because when i try compile this i get an error]
    What makes you think that a compile-error can be caused by a faulty makefile ?
    Kurt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile Problem: None rule to make target
    By chris24300 in forum Linux Programming
    Replies: 25
    Last Post: 06-17-2009, 09:45 AM
  2. Building a project using a Makefile
    By starcatcher in forum Windows Programming
    Replies: 2
    Last Post: 11-23-2008, 11:50 PM
  3. unix makefile won't work but works in Dev C++
    By jk1998 in forum C++ Programming
    Replies: 1
    Last Post: 06-09-2007, 03:54 PM
  4. makefile blues....
    By WaterNut in forum C Programming
    Replies: 6
    Last Post: 05-30-2005, 08:22 PM
  5. Need help with Makefile
    By xshapirox in forum C++ Programming
    Replies: 14
    Last Post: 09-28-2004, 03:32 PM