User forums > Help

Problem setting up new compiler

<< < (2/3) > >>

oBFusCATed:
Just run g++ main.cpp (you have to use proper paths for g++ and main.cpp).
If this doesn't work, check out the manual or support forum for your compiler.

stahta01:

--- 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()'|

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

--- End quote ---

This is likely wrong.
Likely need "C:\msys64\mingw32"


--- Quote from: thor36 on December 08, 2015, 01:50:25 pm ---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

--- End quote ---

This may be wrong I use "ar.exe"


--- Quote from: thor36 on December 08, 2015, 01:50:25 pm ---Resource compiler:
windres.exe

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

Thank you,
T

--- End quote ---

I also edited "Cygwin GCC" compiler instead of the "GNU GCC Compiler".

Edit: Please read and follow this FAQ if you still need help!
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.


stahta01:
FYI:

Adding the compiler search folders is NOT needed for MSYS2; and, if you do add paths for 3rd party libs/header use a forward slash!

MSYS2 does NOT like "\" backslashes in paths passed to the compiler.

Edit: The type of third party libs makes a difference in how to fix the errors.
1. Self-Compiled third party libs
2. MSys2 third party MinGW libs (I am working on a custom built Code::Blocks to make this easier to do.)
3. third party libs downloaded as binary libs. (This is NOT likely to work unless the libraries are C libraries!)

Tim S.


--- Quote from: cacb on December 08, 2015, 03:54:30 pm ---
--- 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

--- End quote ---

MortenMacFly:

--- Quote from: thor36 on December 08, 2015, 01:50:25 pm ---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 ---
First of all: This is not a Code::Blocks issue.

However, it seems parts of your code are compiled with C++11. Therefore, try to specify/anable -std=c++11 as compiler option.

Once again: This forum is not for discussing compiler issues. We assume you know what SDK you use and what the requirements are.

thor36:
Ok, thank you all for help.
Alright it is a compiler issue not a Code::Blocks issue I suppose. But it's nice to get support from a community that uses same IDE. Surely it is easier to find someone who can relate to the problem you have (even uses same tools) and can give more specific advice.
Is a new sub-forum for such issues an option?
I am totally aware that core C::B dev team is too busy to deal with such issues, but this community seems large enough to accomodate this. I would even argue that long term impact would be more people moving to C::B.
Anyway, thanks and keep up the great work with C::B and the forums!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version