![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C files searching and Linking | user_prady | High Level Programming | 2 | 02-12-2008 06:49 PM |
| Linking Files in UNIX (shortcuts) | jays337 | UNIX for Dummies Questions & Answers | 3 | 11-15-2006 03:05 PM |
| modifying C file and linking back to project files | bruins2005 | UNIX for Dummies Questions & Answers | 1 | 06-22-2006 08:08 PM |
| beginner at C: Need help compiling/linking with gcc | My_Name | High Level Programming | 1 | 03-06-2005 09:23 AM |
| Linking problem while linking to shared library | laho | High Level Programming | 6 | 03-16-2004 07:01 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Try with a space in between, instead of a comma.
|
|
#3
|
|||
|
|||
|
Or....
Or, put a space after the comma.
|
|
#4
|
|||
|
|||
|
Maybe I'm reading too much in...
Hello-
Maybe I'm interpreting this wrong, but you want to compile two SEPARATE progs, not use one as an include for the other? In the first case, I yield to the other posts and say go with the space in between, but it really looks to me like you want to compile some related progs that are function declarations or something (forgive the c++, it is my first love over and above C)??? In that case, make the one that needs to be compiled first an include: gcc -include file1.cc file2.cc If that helps at all, I'm pleased, Gratzi, loadc |
|
#5
|
|||
|
|||
|
hi!
try this: cc -c file1.c cc file2.c file1.o a.out is the executable created Shaik |
|||
| Google The UNIX and Linux Forums |