Confusing error message for c++ sources
Bug #39870 reported by
Tero Karvinen
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-defaults (Ubuntu) |
Invalid
|
Medium
|
Matthias Klose |
Bug Description
When trying to compile C++ files with 'gcc', a confusing screenfull of weird error messages is given. Instead, it should say something like "To compile C++ files, use g++. For example: 'g++ hello.cc'.
To reproduce:
1) $ cat hello.cc
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hello C++ world!" << std::endl;
return 0;
}
2) $ gcc hello.cc
/tmp/ccI0YbBc.o: In function `main':
[..]
std::operator<< <std::char_
collect2: ld returned 1 exit status
To post a comment you must log in.
note, that the files is correctly compiled; the linking fails. either you add -lstdc++, or just call g++.