Beginner-linking headers

This is a discussion on Beginner-linking headers within the C++ Programming forums, part of the General Programming Boards category; Hi there, I am a complete beginner and need some advice. I have been sent 4 programs, one main program ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    9

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    9
    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, 08: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, 10:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21