User forums > Help

Problem setting up new compiler

(1/3) > >>

thor36:
Greetings,

I downloaded mingw 5.2 compiler that comes with MSYS2 package (Win 7, 64 bit). Then I tried to set up new compiler in settings -> compiler -> toolchain executables in Code Blocks, by altering compiler's installation directory and program paths.

When I tried to build an application I got various errors, some about 3rd party library I used and some about standard library, like this one:
main.cpp|42|undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'|

So I assume I made mistakes when setting up compiler in the settings (I also ticked C++11 support in build options). Can someone help identify what I did wrong? My settings are like this:

compiler's installation directory:
C:\msys64\mingw32\bin

C compiler:
i686-w64-mingw32-gcc-5.2.0.exe

C++ compiler:
i686-w64-mingw32-g++.exe

Linker for dynamic libs:
i686-w64-mingw32-g++.exe

Linker for static libs:
i686-w64-mingw32-gcc-ar.exe

Resource compiler:
windres.exe

Make program:
/ (can't see ming32-make in bin folder)

Thank you,
T

cacb:

--- Quote from: thor36 on December 08, 2015, 01:50:25 pm ---Greetings,

I downloaded mingw 5.2 compiler that comes with MSYS2 package (Win 7, 64 bit). Then I tried to set up new compiler in settings -> compiler -> toolchain executables in Code Blocks, by altering compiler's installation directory and program paths.

When I tried to build an application I got various errors, some about 3rd party library I used and some about standard library, like this one:
main.cpp|42|undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'|

--- End quote ---

Hi,
I don't use that compiler, but for the standard library stuff (that comes with the toolchain), I think you need to add proper compiler and linker search directories under.

Global compiler Settings -> Search directories -> Compiler/Linker

For 3rd party libraries it is best to do it under each project: Build Options

thor36:
You are right cacb, this was exactly the problem, thank you very much. Previously I used MinGW bundled with CB and it did the work automatically. Correct settings (that seem to work at least for my test project) are:

Compiler:
C:\msys64\mingw32\i686-w64-mingw32\include

Linker:
C:\msys64\mingw32\i686-w64-mingw32\lib

oBFusCATed:
This should work automatically, the compiler should know where the bits for the standard library are.
So either it is broken or your installation is broken.

To verify it try it on the command line.

thor36:

--- Quote from: oBFusCATed on December 08, 2015, 08:41:22 pm ---This should work automatically, the compiler should know where the bits for the standard library are.
So either it is broken or your installation is broken.

To verify it try it on the command line.

--- End quote ---

Sorry, I  don't know how to verify it on the command line, can you please explain that?

Navigation

[0] Message Index

[#] Next page

Go to full version