Thread: Beginner-linking headers

  1. #1
    Registered User
    Join Date
    Oct 2011

    Beginner-linking headers

    Hi there,

    I am a complete beginner and need some advice. I have been sent 4 programs, one main program "calDD.c" which has [code] #include"header.h"[\code] on the first line. I have also been sent "header.h", "integration.c" and "util.c". where the two C files contain information that is used in the header file. I have looked at all the info given but can not work out how to link/compile them properly. I have resorted to cutting the required code from the other files into the main file and running it which works but is not ideal.
    Could anyone let me know the commands I need to sort this out?

    Thank you

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    If all 4 files are in the same directory, then it's simply

    gcc calDD.c integration.c util.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.

  3. #3
    Registered User
    Join Date
    Oct 2011
    OK great, thank you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Question - Linking a data file
    By noiprocs2 in forum C++ Programming
    Replies: 1
    Last Post: 06-16-2008, 08:58 AM
  2. including headers inside headers
    By kromozom in forum C++ Programming
    Replies: 5
    Last Post: 04-18-2005, 10:56 AM
  3. Help understanding Headers and Other beginner stuff
    By Saintdog in forum C++ Programming
    Replies: 3
    Last Post: 12-01-2004, 09:34 PM
  4. Help with headers/linking code
    By xshapirox in forum C++ Programming
    Replies: 5
    Last Post: 09-22-2004, 07:53 PM
  5. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM