Help in creating a file in C

This is a discussion on Help in creating a file in C within the C Programming forums, part of the General Programming Boards category; Hello - I need a help in creating a file in the C. I have a program first.c which is ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    21

    Help in creating a file in C

    Hello - I need a help in creating a file in the C. I have a program first.c which is using a function which is written in second.c.

    I need to compile it together so that first.c can access the function written in second.c.

    Could anyone guide me how should I make a file and compile the files together?

    Thanks

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,047
    Do you need help with "make" or how to code one function visible to another in a different source file?

  3. #3
    Registered User
    Join Date
    Oct 2009
    Location
    While(1)
    Posts
    377
    if u are using gcc then just type the commands on shell

    gcc -g -c -Wall first.c second.c
    gcc -o test first.o second.o

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    21
    cool - this woked - thanks a bunch.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM

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