Read and respond to this message at:
> std::cout << "Hello World!\n";
> hello3: hello3.cpp
> $(CC) -H -v -c $<
> $(CC) -H -v -o $@ hello3.o
Here, it appears that you may be using the C
frontend for C++ source. The compiler itself
recognizes the '.cpp' extension on the filename it's
passed, and treats it as C++. But the linker sees
only a '.o' file and doesn't know what language was
used, so it assumes C, provided that $(CC) resolves
to 'gcc' instead of 'g++', and therefore fails to link
the C++ library, which I guess explains the diagnostic:
> undefined reference to `std::cout'
If your makefile uses conventional names for the C
and C++ compilers, just change $(CC) to $(CXX).
If my guess is incorrect, then make sure you tell us
what $(CC) is defined as.
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
Get latest updates about Open Source Projects, Conferences and News.