Thread: Include in compile

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    24

    Include in compile

    Hey,

    Just wondering if anybody can point me in the right direction.

    I have a program which I want to choose at compile time which
    main file to use (ie main.c || analysis_main.c)

    Can I use this in an ifdef# statement or is this a job for my makefile.

    Any information appreciated.

    Regards

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Probably it would be best to use a make file for that. Something like:

    "make" or "make analysis"

    So that the one uses one .c file and the other uses the second.

    I suppose you could do something with preprocessor stuff, but it would be fairly ugly.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  2. Unable to open include file SDL_audio.h
    By rraj.be in forum C Programming
    Replies: 2
    Last Post: 06-28-2008, 08:04 PM
  3. Help me with function call
    By NeMewSys in forum C++ Programming
    Replies: 16
    Last Post: 05-22-2008, 01:53 PM
  4. Header file include order
    By cunnus88 in forum C++ Programming
    Replies: 6
    Last Post: 05-17-2006, 03:22 PM
  5. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM