Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ HelloWorld program compiled with MinGW crashes with "Illegal Argument"
    primarykey
    data
    text
    <p>I decided it was time that I learned C++, and after struggling for 3+ hours trying to get the compiler to work, I finally created a working program. However, it seemingly spontaneously broke when I tried to refactor the project in Eclipse by cutting and pasting it. The program simply crashes, and Windows brings up the dreaded dialogue "HelloWorld.exe has stopped working." A bit of debugging revealed that "cout" was considered an illegal argument. I looked some more into the issue, and I'm now suspicious that it has something to do with the compiler apparently being 32-bit, as I have a 64-bit system. The executable is listed in Eclipse as "HelloWorld.exe - [x86/le]." (Minus the period.) My program in full is below:</p> <pre><code>#include &lt;iostream&gt; using namespace std; int main(){ cout &lt;&lt; "Hello World!" &lt;&lt; endl; return 0; } </code></pre> <p>I've also just discovered that creating a new "HelloWorld" C++ project in Eclipse does absolutely nothing to fix the issue, even using the unmodified code and settings. Anyone have any suggestions as to why this would happen?</p> <p>EDIT: Debugging information: Upon running the program:</p> <pre><code>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) </code></pre> <p>It should be noted that line 4 of the class now points to the cout call.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload