I decided that the time had come when I learned C ++, and after three hours trying to get the compiler to work, I finally created a working program. However, this would seem to be spontaneously broken when I tried to reorganize the project in Eclipse, cutting it and pasting it into it. The program just crashes, and Windows brings up the dangerous dialog "HelloWorld.exe has stopped working." A bit of debugging showed that "cout" is considered an illegal argument. I looked a little more at this problem, and now I suspect that this is because the compiler is apparently 32-bit because I have a 64-bit system. The executable is listed in Eclipse as "HelloWorld.exe - [x86 / le]". (Minus period.) My program in full is below:
#include <iostream> using namespace std; int main(){ cout << "Hello World!" << endl; return 0; }
I also just discovered that creating a new C ++ "HelloWorld" project in Eclipse absolutely does not help to fix the problem, even using unmodified code and settings. Anyone have any suggestions as to why this will happen?
EDIT: Debugging Information: After starting the program:
Hello World! Program received signal SIGNILL, Illegal instruction. 0x6fccc3c0 in libstdc++-6!_ZSt4cout () from C:\Windows\SysWOW64\libstdc++-6.dll (gdb) bt #0 0x6fccc3c0 in libstdc++-6~_ZSt4cout () from C:\Windows\SysWOW64\libstdc++-6.dll #1 0x6fc8908c in libstdc++-6~_ZSt4cout () from C:\Windows\SysWOW64\libstdc++-6.dll #2 0x004013be in libstdc++-6~_ZSt4cout () at HelloWorld.cpp:4 (gdb)
It should be noted that line 4 of the class now points to a cout call.
source share