How to Compile C++ programs

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Fri Oct 15 08:26:13 UTC 2004


On Thu, 14 Oct 2004, John Vetterli wrote:

> On Wed, 13 Oct 2004 12:25:04 -0400
> Jing Su <jingsu-26n5VD7DAF2Tm46uYYfjYg at public.gmane.org> wrote:
>> have you tried just doing 'gcc fill.cc'?
>
> This won't work: gcc will recognize the .cc extension as
> indicating a C++ file, but for the linking stage you need to use g++ so
> that the C++ support libraries are included in the link.  Otherwise, you
> wind up with a lot of "undefined reference" errors.

Use a blank makefile and do make fill.cc . The default makefile rules 
should fix it for you. You make a blank makefile using touch Makefile. 
This works for c and should work for cc and all other languages supported 
by default by gnu make.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list