Under CodeBlock GCC environment editor, compiler error: Execution of '. Mingw32-g ++ exe -o bin \ Debug \ test.exe obj \ Debug \ main.o' in 'C

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:

  1. settings->compiler
  2. Confirm GNU GCC compiler chain
  3. Switch to the Toolchain executables
  4. 将Linker for dynamic libs from mingw32-g++.exe to mingw32-gcc.exe
  5. Save, recompile


 

Published 133 original articles · won praise 129 · views 330 000 +

Guess you like

Origin blog.csdn.net/wofreeo/article/details/103738078