Install or Setup Issue
I'm having an install or setup issue. I can not get Clion to recognize the mingw-w64 install and have it work, I probably have something set wrong or I grabbed the wrong version, but I can't fiure out which one is correct.
I'm using this version on MinGW-w64 http://mingw-w64.sourceforge.net/download.php#win-builds; the "Win-builds - stable, native- and cross- compilers with libraries and package manager" version. I've installed the 32-bit and 64-bit versions and neither of them work.
I've installed and set clion to use this one: "C:\mingw-w64_32"
I'm trying to compile this simple example:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int number = 10;
cout << "Hello, World!" << to_string(number) << endl;
return 0;
}
This is the CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(Test_Compiler)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(Test_Compiler ${SOURCE_FILES})
It gives this error, before compiling and won't compile:
Error:The C++ compiler "C:/win-builds-64/bin/g++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/503611/.clion10/system/cmake/generated/b6d0ccc4/b6d0ccc4/__default__/CMakeFiles/CMakeTmp
Run Build Command:c:/MinGW/bin/mingw32-make.exe "cmTryCompileExec2034351222/fast"
c:/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTryCompileExec2034351222.dir\build.make CMakeFiles/cmTryCompileExec2034351222.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/503611/.clion10/system/cmake/generated/b6d0ccc4/b6d0ccc4/__default__/CMakeFiles/CMakeTmp'
"C:\Program Files (x86)\JetBrains\CLion 140.569.17\bin\cmake\bin\cmake.exe" -E cmake_progress_report C:\Users\503611\.clion10\system\cmake\generated\b6d0ccc4\b6d0ccc4\__default__\CMakeFiles\CMakeTmp\CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec2034351222.dir/testCXXCompiler.cxx.obj
C:\win-builds-64\bin\g++.exe -o CMakeFiles\cmTryCompileExec2034351222.dir\testCXXCompiler.cxx.obj -c C:\Users\503611\.clion10\system\cmake\generated\b6d0ccc4\b6d0ccc4\__default__\CMakeFiles\CMakeTmp\testCXXCompiler.cxx
Linking CXX executable cmTryCompileExec2034351222.exe
"C:\Program Files (x86)\JetBrains\CLion 140.569.17\bin\cmake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTryCompileExec2034351222.dir\link.txt --verbose=1
"C:\Program Files (x86)\JetBrains\CLion 140.569.17\bin\cmake\bin\cmake.exe" -E remove -f CMakeFiles\cmTryCompileExec2034351222.dir/objects.a
C:\win-builds-64\bin\ar.exe cr CMakeFiles\cmTryCompileExec2034351222.dir/objects.a @CMakeFiles\cmTryCompileExec2034351222.dir\objects1.rsp
C:\win-builds-64\bin\g++.exe -Wl,--whole-archive CMakeFiles\cmTryCompileExec2034351222.dir/objects.a -Wl,--no-whole-archive -o cmTryCompileExec2034351222.exe -Wl,--out-implib,libcmTryCompileExec2034351222.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
c:/win-builds-64/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lstdc++
c:/win-builds-64/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_s
c:/win-builds-64/bin/../lib64/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lgcc_s
collect2.exe: error: ld returned 1 exit status
CMakeFiles\cmTryCompileExec2034351222.dir\build.make:88: recipe for target 'cmTryCompileExec2034351222.exe' failed
mingw32-make.exe[1]: *** [cmTryCompileExec2034351222.exe] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/503611/.clion10/system/cmake/generated/b6d0ccc4/b6d0ccc4/__default__/CMakeFiles/CMakeTmp'
Makefile:113: recipe for target 'cmTryCompileExec2034351222/fast' failed
mingw32-make.exe: *** [cmTryCompileExec2034351222/fast] Error 2
CMake will not be able to correctly generate this project.
The toolchain settings are in the attached image.
What'd I do wrong?
Attachment(s):
Settings_2014-12-02_11-48-25.jpg
Please sign in to leave a comment.
Hi Aaron,
Please try using this mingw-w64 installer.
Ok, will do later today. Hopefully this fix the issue. So far I'm really liking this tool.
Thanks