Compiling multiple files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Compiling multiple files
# 1  
Old 02-28-2011
Compiling multiple files

Hey there,hope you are all well.

Actually i am trying to compile two .c files with gcc in unix and i also have one .txt and one .h..How do i compine them alltogether in order for my program to run?
I will have to do gcc -o myprog myprog1.c myprog2.c and then how i will use myprog with the .txt and the .h?:S

Thanks in advance!
# 2  
Old 03-01-2011
Well, .h is pulled in by #include, you have the .c files on the command line, hopefully in the right order, and what is in a .txt file that relates to this? Should it be renamed .c and put on the command line?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to write files for compiling a program.?

I am hoping someone can give me a good free web resource for writing code to compile a binary executable. I am getting fairly decent at writing shell script, are the .f files just shell scripts? Also, I don't know where to begin on the makefiles. The reason I am curious is because I have been... (6 Replies)
Discussion started by: butson
6 Replies

2. UNIX for Dummies Questions & Answers

Using AWK: Extract data from multiple files and output to multiple new files

Hi, I'd like to process multiple files. For example: file1.txt file2.txt file3.txt Each file contains several lines of data. I want to extract a piece of data and output it to a new file. file1.txt ----> newfile1.txt file2.txt ----> newfile2.txt file3.txt ----> newfile3.txt Here is... (3 Replies)
Discussion started by: Liverpaul09
3 Replies

3. Linux

Compiling with multiple versions of a library

Hello! I have a set of headers and libraries I want to use but they are mixed with ones I do not want to use. They are part of some official stuff, so I cannot modify them while begging and pleading for weeks. These headers and libraries are located here /long/official/path/to/include... (0 Replies)
Discussion started by: gobi
0 Replies

4. Shell Programming and Scripting

Compiling multiple ".c" files starting with xxx

Hello, I am trying to figure out how I can write a bashscript that compiles several ".c" files that start with xxx (example: xxx_try.c and xxx_that.c) So I want to compile all these files with a bash script. Anyone can help pls? (6 Replies)
Discussion started by: Freak79
6 Replies

5. Programming

Compiling kernel mnodule spanning multiple files

Hello i guys i have a kernel module which has a list.c library I have one file mod.c (the main kernel module) and one list.c (which is the library) Could you please help me with the following questions .. 1) Is a header file needed (list.h) to be included in the mod.c ? 2) do we need to... (0 Replies)
Discussion started by: natraj
0 Replies

6. Solaris

compiling all 'C' files in one command

Hi, I have a directory structure containing 'C' files scattered in all sub folders. Now I want to compile all 'C' files using gcc command. I am using following command - find . -name "*.c" -exec gcc -o `basename {} .c` {} \; but is not working. also find . -name "*.c" | xargs -i... (1 Reply)
Discussion started by: sanjay1979
1 Replies

7. Programming

Compiling multiple cpp files (abstract factory pattern)

Hi all, I have been working with java for awhile and because of my school projects I needed to switch C++. I tried to implement some patterns in C++ but unfortunately I couldn't. Specifically, I tried to implement abstract factory pattern but since I used separated files (habitual behavior from... (4 Replies)
Discussion started by: SaTYR
4 Replies

8. UNIX for Advanced & Expert Users

Un-Compiling Files ??

I am using NCR Unix, with a progress database. There are files that suddenly appear that are compiled (*.r) and I can't figure out where they are comming from. Is there any way I can uncompile them? That way, I can possibly read them and find out where they are comming from? Any ideas... (2 Replies)
Discussion started by: tripp4337
2 Replies

9. Programming

compiling and linking 2 C files ...??

Hi mates, I am trying to copile and link to C programs with command: cc file1,file2 but i raises the error "file not found" ... am i doing the right way? any suggestion will be appreciated. thanks abdul (4 Replies)
Discussion started by: abdul
4 Replies

10. Programming

Including lib files when compiling

I am using the C compiler included with AIX 4.3.3. I am unable to include libraries when I try to create the executable. Is there a switch that has to be used at compile time to make this happen?? Can anyone help?? (2 Replies)
Discussion started by: andrewl68
2 Replies
Login or Register to Ask a Question