This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cannot get 'Hello World' to compile


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@gmail.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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]