I am trying to setup MingW and Code::Blocks on my Windows 8 64 bit laptop, and I'm facing some problem while building a main.cpp
file. These are the versions that I have installed:
- x86_64-w64-mingw32-gcc-4.7.4-release-win64_rubenvb.7z for MingW (4th one in that list), and
- codeblocks-12.11-setup.exe for Code::Blocks.
I've set the path to mingw64\bin
in the environment variable. Also, in the Code::Blocks compiler settings, I have set path for all ToolChain Executables. There are two gcc in the MingW bin path. One is - gcc.exe
and other is - x86_64-w64-mingw32-gcc.exe
. Same for C++ Compiler, Linker for static and dynamic libs. Now when I try to build a simple Hello World file, it shows some errors:
obj\Debug\main.o -- In function swscanf
c:\mingw\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\4.7.3\..\..\..\..\x86_64-w64-mingw32\include\wchar.h -- undefined reference to `__gxx_personality_sj0'
obj\Debug\main.o -- In function `wscanf':
c:\mingw\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\4.7.3\..\..\..\..\x86_64-w64-mingw32\include\wchar.h -- undefined reference to `__gxx_personality_sj0'
Similarly there are many errors and undefined references for - fwprintf
, wprintf
, std:cout
, etc..
I'm sure there is some configuration problem, but I cannot find out what's the issue. Can any one take a look at the problem.
Here's the code I'm running:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}