User forums > Help
No console output with mingw-w64-gcc-4.8.0-stable-r7
(1/1)
Shekhu:
Hi,
I downloaded mingw-w64-gcc-4.8.0-stable-r7 and wrote a simple program before moving on to unique pointers (C++11).
--- Code: ---#include<iostream>
using namespace std;
int main()
{
cout<<"hello"<<endl;
return 0;
}
--- End code ---
The code compiles without errors, but I get no output on running it.
--- Code: ---Process returned 1970924701 (0x7579EC9D) execution time : 0.002 s
Press any key to continue.
--- End code ---
I'm running it on 32 bit Vista.
When I compile with option "-m32", I get the following errors while compiling.
--- Code: ---C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `___main'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZSt4cout'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZNSolsEPFRSoS_E'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZNSt8ios_base4InitD1Ev'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `__ZNSt8ios_base4InitC1Ev'|
C:\Users\Shekhu.ROMMELSMACHINE\Documents\Code Blocks Programs\auto.o:auto.cpp|| undefined reference to `_atexit'|
||=== Build finished: 8 errors, 0 warnings (0 minutes, 0 seconds) ===|
--- End code ---
Can anybody please help? And I have the option -std=C++11 set.
Alpha:
Those are link time errors; it appears that you have somehow disabled the standard runtime library, however, it is difficult to find the cause without the full build log.
If you do not specifically need GCC 4.8, I recommend using the TDM build, which works well out of the box.
Shekhu:
Thanks Alpha. I have installed TDM GCC. It's working fine. I wanted to get a hands-on on the C++ features. So i downloaded 4.8. But looks like 4.7 also supports these new features.
Navigation
[0] Message Index
Go to full version