CLion 2016.3.3 Can't Compile Simple Test Program
I'm running CLion on Windows 10 64-bit. I downloaded CLion 2016.3.3, and downloaded Cygwin64, which included GCC 5.4.0, and CMake 3.3.2. CLion starts up and it seems to find gcc, gdb, and cmake OK. When I create a new project, it tries to go thru the 'simple test program' self-configuration. I then get the following errors.
What do I need to fix/change?
C:\Users\xxxx\.CLion2016.3\system\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -L C:\Windows\System32 -G "CodeBlocks - Unix Makefiles" /cygdrive/c/Users/xxxx/CLionProjects/untitled
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /cygdrive/c/Users/xxxx/.CLion2016.3/system/cygwin_cmake/share/cmake-3.6.3/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_44d2e/fast"
/usr/bin/make -f CMakeFiles/cmTC_44d2e.dir/build.make
CMakeFiles/cmTC_44d2e.dir/build
make[1]: Entering directory
'/cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_44d2e.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_44d2e.dir/testCCompiler.c.o -c
/cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_44d2e.exe
/cygdrive/c/Users/xxxx/.CLion2016.3/system/cygwin_cmake/bin/cmake.exe -E
cmake_link_script CMakeFiles/cmTC_44d2e.dir/link.txt --verbose=1
/usr/bin/cc -Wl,--enable-auto-import
CMakeFiles/cmTC_44d2e.dir/testCCompiler.c.o -o cmTC_44d2e.exe
-Wl,--out-implib,libcmTC_44d2e.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -ladvapi32
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lshell32
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -luser32
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lkernel32
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_44d2e.dir/build.make:98: cmTC_44d2e.exe]
Error 1
make[1]: Leaving directory
'/cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_44d2e/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/cygdrive/c/Users/xxxx/CLionProjects/untitled/cmake-build-debug/CMakeFiles/CMakeError.log".
-- Cache values
CMAKE_BUILD_TYPE:STRING=Debug
CMAKE_CODEBLOCKS_EXECUTABLE:FILEPATH=CMAKE_CODEBLOCKS_EXECUTABLE-NOTFOUND
CMAKE_CODEBLOCKS_MAKE_ARGUMENTS:STRING=-j4
CMAKE_INSTALL_PREFIX:PATH=/usr/local
Please sign in to leave a comment.
Hi! You might have to install w32api-runtime cygwin package. It looks like gcc doesn't have these dependencies in cygwin, but is linked with them for some reason. Please take a look at http://stackoverflow.com/questions/31759666/not-able-to-compile-c-using-cygwin.
Thanks, that fixed it!