Installation CodeBlock programming software, install the GCC compiler chain. GCC compiler chain after the installation is complete, you should see a successful installation information. New construction, select GCC compiler chain, after compilation, given as follows:
Execution of 'mingw32-g++.exe -o bin\Debug\test.exe obj\Debug\main.o' in 'C
Compile the project is successful, main.o also successfully generated, the problem lies in the link stage.
mingw32-g ++. exe for compilation phase, its successful implementation, mingw32-g ++. exe for a link fails. Most likely problem is the installation MINGW compile chain, g ++ is not installed, or the PATH is wrong, you can. Exe see the results in cmd window run mingw32-g ++.
CodeBlock default link options are g ++, its C / C ++ are well supported, and that it assume that you are a full C / C ++ toolchain installation.
Solution:
- settings->compiler
- Confirm GNU GCC compiler chain
- Switch to the Toolchain executables
- 将Linker for dynamic libs from mingw32-g++.exe to mingw32-gcc.exe
- Save, recompile