www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/28/08:31:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <25188895.post@talk.nabble.com>
References: <25188895 DOT post AT talk DOT nabble DOT com>
Date: Fri, 28 Aug 2009 12:31:43 +0000
Message-ID: <f60fe000908280531j433aa646s7a26de5c0154c54e@mail.gmail.com>
Subject: Re: Cannot get 'Hello World' to compile
From: "Mark J. Reed" <markjreed AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

You named your program with a .c and ran gcc on it. Both of those mean
C, which is a different language from C++.   A C++ compiler will
compile a C program, but not the other way around.

Rename your file to end in .cc, .c++, .cpp, or .cxx, your choice (or
capital .C if you have case sensitivity turned on), and run "g++"
instead of "gcc".


-- 
Mark J. Reed <markjreed AT gmail DOT com>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019