The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 09-18-2001
Registered User
 

Join Date: Aug 2001
Posts: 10
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
Reply With Quote
Forum Sponsor
  #2  
Old 09-18-2001
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Try with a space in between, instead of a comma.
Reply With Quote
  #3  
Old 09-24-2001
Registered User
 

Join Date: Sep 2001
Location: Maine
Posts: 2
Or....

Or, put a space after the comma.
Reply With Quote
  #4  
Old 09-28-2001
Registered User
 

Join Date: Sep 2001
Posts: 40
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
Reply With Quote
  #5  
Old 10-02-2001
shaik786
Guest
 

Posts: n/a
hi!

try this:

cc -c file1.c
cc file2.c file1.o

a.out is the executable created

Shaik
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0