Thread: djgpp compiling again (salem?)

  1. #1
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140

    Arrow djgpp compiling again (salem?)

    hi!

    can someone please post a complete syntax code for compiling the following files into an *.exe file using djgpp(gcc)?

    my program includes the following files

    prox.c - which is the main source code
    my_header.h - which includes function prototypes
    my_h_func.c - which includes the function definitions

    gcc ... blah? sorry... i already looked in the manual - but i won't find help here. salem posted something in another thread, but i need an explained exercise, please... thank you!

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    gcc -O -Wall -c *.c
    gcc -O -o myfileexecutablenamehere *.o

    MERC is your friend.

    Quzah.

  3. #3
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    thank you very much!

    but: what's up with my_header.h ? *sigh*

    and: who or what is MERC?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > prox.c - which is the main source code
    > my_header.h - which includes function prototypes
    > my_h_func.c - which includes the function definitions

    1. Make sure this line is in both prox.c and my_h_func.c
    Code:
    #include "my_header.h"
    It's like any other .h file you #include, it's just a number of definitions - like function prototypes, structures, #defines etc.

    2. This is the command line to compile
    gcc -o prog.exe prox.c my_h_func.c
    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.

  5. #5
    Registered User dune911's Avatar
    Join Date
    Sep 2001
    Posts
    140
    a big thank you @ all

    now i understand how the header files are included in the .exe (silly me, huh?)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. Wav edit programmation for dos with DJGPP
    By sprudhom in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 07-17-2003, 07:35 AM
  3. DJGPP project problems
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 06-08-2002, 07:16 PM
  4. DJGPP assembly syntax ills...
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-11-2001, 02:54 AM
  5. DJGPP help needed
    By dune911 in forum C++ Programming
    Replies: 6
    Last Post: 09-15-2001, 04:56 PM