I am trying to set up Clion on my pc. I tried both Clion and mingw and I get the same error when I point to the tool chain location. I install and uninstall all the required packages for both following the instructions and I can't get it working.
Anyone else has run into this set up issue?
This is the error I am getting:
Error:The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_4ce80/fast"
/usr/bin/make -f CMakeFiles/cmTC_4ce80.dir/build.make CMakeFiles/cmTC_4ce80.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_4ce80.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_4ce80.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_4ce80.dir/testCXXCompiler.cxx.o -o cmTC_4ce80.exe -Wl,--out-implib,libcmTC_4ce80.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_4ce80.dir/build.make:98: cmTC_4ce80.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/__default__/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_4ce80/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration Debug
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_4526e/fast"
/usr/bin/make -f CMakeFiles/cmTC_4526e.dir/build.make CMakeFiles/cmTC_4526e.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_4526e.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_4526e.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_4526e.dir/testCXXCompiler.cxx.o -o cmTC_4526e.exe -Wl,--out-implib,libcmTC_4526e.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_4526e.dir/build.make:98: cmTC_4526e.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Debug/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_4526e/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration Release
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_0c461/fast"
/usr/bin/make -f CMakeFiles/cmTC_0c461.dir/build.make CMakeFiles/cmTC_0c461.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_0c461.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_0c461.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_0c461.dir/testCXXCompiler.cxx.o -o cmTC_0c461.exe -Wl,--out-implib,libcmTC_0c461.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0c461.dir/build.make:98: cmTC_0c461.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/Release/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_0c461/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration RelWithDebInfo
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_0238e/fast"
/usr/bin/make -f CMakeFiles/cmTC_0238e.dir/build.make CMakeFiles/cmTC_0238e.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_0238e.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_0238e.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_0238e.dir/testCXXCompiler.cxx.o -o cmTC_0238e.exe -Wl,--out-implib,libcmTC_0238e.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_0238e.dir/build.make:98: cmTC_0238e.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/RelWithDebInfo/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_0238e/fast] Error 2
CMake will not be able to correctly generate this project.
Error:Configuration MinSizeRel
The C++ compiler "/usr/bin/c++.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_7f6fc/fast"
/usr/bin/make -f CMakeFiles/cmTC_7f6fc.dir/build.make CMakeFiles/cmTC_7f6fc.dir/build
make[1]: Entering directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o
/usr/bin/c++.exe -o CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o -c /cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_7f6fc.exe
/cygdrive/c/Users/satin/.CLion2016.2/system/cygwin_cmake/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_7f6fc.dir/link.txt --verbose=1
/usr/bin/c++.exe -Wl,--enable-auto-import CMakeFiles/cmTC_7f6fc.dir/testCXXCompiler.cxx.o -o cmTC_7f6fc.exe -Wl,--out-implib,libcmTC_7f6fc.dll.a -Wl,--major-image-version,0,--minor-image-version,0
c++: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_7f6fc.dir/build.make:98: cmTC_7f6fc.exe] Error 1
make[1]: Leaving directory '/cygdrive/c/Users/satin/.CLion2016.2/system/cmake/generated/untitled-9502414e/9502414e/MinSizeRel/CMakeFiles/CMakeTmp'
make: *** [Makefile:126: cmTC_7f6fc/fast] Error 2
CMake will not be able to correctly generate this project.
Cygwin's C++ compiler (or probably linker) can't find cyglto_plugin.dll which can be part of several Cygwin packages. I'm not sure how Clion works - whether it requires Cygwin to be installed or brings it in its own installer. If it requires that user installs Cygwin - verify that you have installed appropriate package and that mentioned DLL is in place.
I removed all the packages and reinstalled them. I think when you have the options to download it allows you to download multiple versions. Which is what i did and then it causes a conflict. issue was resolved.
Related
I am trying to compile a simple C++ program with CMake on Ubuntu 18.04, but all of my CMake projects fails when I run the make command.
Below is a minimum working example.
The directory structure looks like this:
- project directory
|-build
|-main.cpp
|-CMakeLists.txt
main.cpp
int main(void)
{
return 0;
}
CMakeLists.txt
cmake_minimum_required (VERSION 3.1)
project(Test-Project)
add_executable(a
main.cpp
)
target_compile_options(a
PUBLIC -Wall -o -std=c++11
)
Building
cd build
cmake ../ # this works without any error
make # this fails
Error
[ 50%] Building CXX object CMakeFiles/a.dir/main.cpp.o
cc1plus: fatal error: CMakeFiles/a.dir/main.cpp.d: No such file or directory
compilation terminated.
CMakeFiles/a.dir/build.make:75: recipe for target 'CMakeFiles/a.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/a.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/a.dir/all' failed
make[1]: *** [CMakeFiles/a.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
I get this error when try to compile any CMake based program on the system.
However, if I just used g++ directly to compile the program, it compiles without any complaints.
For example:
g++ ../main.cpp
compiles the program, and runs the program without any errors.
cmake --version: cmake version 3.22.1
g++ --version: g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
g++ -print-prog-name=cc1plus: /usr/lib/gcc/x86_64-linux-gnu/7/cc1plus
uname -a: Linux <computer name> 5.4.0-91-generic #102~18.04.1-Ubuntu SMP <date+time> x86_64 x86_64 x86_64 GNU/Linux
EDIT
Terminal output when compiled with make VERBOSE=1:
/home/kani/.local/lib/python2.7/site-packages/cmake/data/bin/cmake -S/home/kani/Documents/test -B/home/kani/Documents/test/build --check-build-system CMakeFiles/Makefile.cmake 0
/home/kani/.local/lib/python2.7/site-packages/cmake/data/bin/cmake -E cmake_progress_start /home/kani/Documents/test/build/CMakeFiles /home/kani/Documents/test/build//CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/kani/Documents/test/build'
make -f CMakeFiles/a.dir/build.make CMakeFiles/a.dir/depend
make[2]: Entering directory '/home/kani/Documents/test/build'
cd /home/kani/Documents/test/build && /home/kani/.local/lib/python2.7/site-packages/cmake/data/bin/cmake -E cmake_depends "Unix Makefiles" /home/kani/Documents/test /home/kani/Documents/test /home/kani/Documents/test/build /home/kani/Documents/test/build /home/kani/Documents/test/build/CMakeFiles/a.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/kani/Documents/test/build'
make -f CMakeFiles/a.dir/build.make CMakeFiles/a.dir/build
make[2]: Entering directory '/home/kani/Documents/test/build'
[ 50%] Building CXX object CMakeFiles/a.dir/main.cpp.o
/usr/bin/c++ -Wall -o -std=c++11 -MD -MT CMakeFiles/a.dir/main.cpp.o -MF CMakeFiles/a.dir/main.cpp.o.d -o CMakeFiles/a.dir/main.cpp.o -c /home/kani/Documents/test/main.cpp
cc1plus: fatal error: CMakeFiles/a.dir/main.cpp.d: No such file or directory
compilation terminated.
CMakeFiles/a.dir/build.make:75: recipe for target 'CMakeFiles/a.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/a.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/home/kani/Documents/test/build'
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/a.dir/all' failed
make[1]: *** [CMakeFiles/a.dir/all] Error 2
make[1]: Leaving directory '/home/kani/Documents/test/build'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
Despite the error message about absent .d file seems to be internal to CMake (such files are used for collect header dependencies generated by the compiler), its usual reason is specifying some output-controlling compiler options in the CMakeLists.txt.
In your case it is -o option which damages the command line generated by CMake. CMake by itself uses this option for specify object file which will be created as a result of the compilation. So adding another -o is wrong.
I have a problem while running cmake with a mingw32 custom compiler in a cygwin terminal.
I have already tried several approaches to fix my problem, until I got to the point where it only fails on finding testCCompiler.c from the directory CmakeTmp.
When I try to manually make the temporary files after cmake failed, the make command runs successfully. (Used --debug-trycompile to keep temporary files)
This is the output from the CMakeError.log file:
Determining if the C compiler works failed with the following output:
Change Dir: /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make.exe" "cmTC_5e0c4/fast"
/usr/bin/make -f CMakeFiles/cmTC_5e0c4.dir/build.make CMakeFiles/cmTC_5e0c4.dir/build
make[1]: Verzeichnis „/cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp“ wird betreten
Building C object CMakeFiles/cmTC_5e0c4.dir/testCCompiler.c.o
/opt/mingw32-1.6.0/bin/i686-w64-mingw32-gcc-6.1.0.exe -o CMakeFiles/cmTC_5e0c4.dir/testCCompiler.c.o -c /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/testCCompiler.c
i686-w64-mingw32-gcc-6.1.0.exe: error: /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/testCCompiler.c: No such file or directory
i686-w64-mingw32-gcc-6.1.0.exe: fatal error: no input files
compilation terminated.
make[1]: *** [CMakeFiles/cmTC_5e0c4.dir/build.make:66: CMakeFiles/cmTC_5e0c4.dir/testCCompiler.c.o] Fehler 1
make[1]: Verzeichnis „/cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp“ wird verlassen
make: *** [Makefile:126: cmTC_5e0c4/fast] Fehler 2
As I see it, the file testCCompiler.c is missing while running gcc-6.1.0.
But when I compile it manually after cmake has failed, it runs successfully. When I run make in the specific directory it works as well (BUT: compiler identification is 6.4.0 while my custom compiler id is 6.1.0).
Running mingw32-make manually for testCCompiler.c:
/usr/bin/cmake.exe -H/cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp -B/cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp --check-build-system CMakeFiles/Makefile.cmake 0
-- The C compiler identification is GNU 6.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp
/usr/bin/cmake.exe -E cmake_progress_start /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/CMakeFiles /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/CMakeFiles/progress.marks
C:/Cygwin/opt/mingw32-1.6.0/bin/mingw32-make -f CMakeFiles/Makefile2 all
mingw32-make[1]: Entering directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
C:/Cygwin/opt/mingw32-1.6.0/bin/mingw32-make -f CMakeFiles/cmTC_033c1.dir/build.make CMakeFiles/cmTC_033c1.dir/depend
mingw32-make[2]: Entering directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
cd /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_033c1.dir/DependInfo.cmake --color=
Scanning dependencies of target cmTC_033c1
mingw32-make[2]: Leaving directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
C:/Cygwin/opt/mingw32-1.6.0/bin/mingw32-make -f CMakeFiles/cmTC_033c1.dir/build.make CMakeFiles/cmTC_033c1.dir/build
mingw32-make[2]: Entering directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
[ 50%] Building C object CMakeFiles/cmTC_033c1.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_033c1.dir/testCCompiler.c.o -c /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/testCCompiler.c
[100%] Linking C executable cmTC_033c1.exe
/usr/bin/cmake.exe -E cmake_link_script CMakeFiles/cmTC_033c1.dir/link.txt --verbose=1
/usr/bin/cc -Wl,--enable-auto-import CMakeFiles/cmTC_033c1.dir/testCCompiler.c.o -o cmTC_033c1.exe -Wl,--out-implib,libcmTC_033c1.dll.a -Wl,--major-image-version,0,--minor-image-version,0
mingw32-make[2]: Leaving directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
[100%] Built target cmTC_033c1
mingw32-make[1]: Leaving directory 'D:/programming/cpp/T2D/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake.exe -E cmake_progress_start /cygdrive/d/programming/cpp/T2D/build/CMakeFiles/CMakeTmp/CMakeFiles 0
My top level CMakeLists.txt is just a simple one, for testing my toolchain configuration:
cmake_minimum_required(VERSION 2.8)
project(T2D)
add_executable(T2D main.cpp)
The cmake command is in a seperate bash file and looks like this:
cmake .. --debug-trycompile -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc-6.1.0 \
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ \
-DCMAKE_LIBRARY_PATH="/opt/mingw32-1.6.0/lib/gcc/i686-w64-mingw32/6.1.0 /opt/mingw32-1.6.0/i686-w64-mingw32/lib" \
-DCMAKE_INCLUDE_PATH="/opt/mingw32-1.6.0/lib/gcc/i686-w64-mingw32/6.1.0/include /opt/mingw32-1.6.0/lib/gcc/i686-w64-mingw32/6.1.0/include-fixed /opt/mingw32-1.6.0/lib/gcc/i686-w64-mingw32/6.1.0/include/c++ /opt/mingw32-1.6.0/i686-w64-mingw32/include/"
Does anyone see what's going wrong, besides the wrong compiler identification? (How does that happen anyway? I've already tried setting the CC and CXX vars too, but that still doesnt change anything; make and mingw32-make still always use 6.4.0 instead of 6.1.0)
System: I am using Linux Mint 17.3 as VB-Guest on a Max OS 10.11.3 system.
Problem: Id like to compile freeglut3.0.0
Issue: cmake gives me an fatal error: usbhid.h: No such file or directory
Hello,
The problem is, that even after installing all dependencies I cannot find this file on my system. After researching I found out that it has something to do with some usb-drivers. Could it be that it has something to do with The VB-System with no "actual" usb-hardware?
or is there a package that I am missing.
I installed libgl1-mesa-dev, libx11-dev, libxrandr-dev and libxi-dev
Here I attached the CMakeError.log
Determining if files usbhid.h exist failed with the following output:
Change Dir: /opt/freeglut-3.0.0/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec2451224769/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2451224769.dir/build.make CMakeFiles/cmTryCompileExec2451224769.dir/build
make[1]: Entering directory `/opt/freeglut-3.0.0/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /opt/freeglut-3.0.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2451224769.dir/CheckIncludeFiles.c.o
/usr/bin/cc -Wall -pedantic -o CMakeFiles/cmTryCompileExec2451224769.dir/CheckIncludeFiles.c.o -c /opt/freeglut-3.0.0/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
/opt/freeglut-3.0.0/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:2:20: fatal error: usbhid.h: No such file or directory
#include <usbhid.h>
^
compilation terminated.
make[1]: Leaving directory `/opt/freeglut-3.0.0/CMakeFiles/CMakeTmp'
make[1]: *** [CMakeFiles/cmTryCompileExec2451224769.dir/CheckIncludeFiles.c.o] Error 1
make: *** [cmTryCompileExec2451224769/fast] Error 2
Source:
/* */
#include <usbhid.h>
int main(){return 0;}
Determining if the function XParseGeometry exists failed with the following output:
Change Dir: /opt/freeglut-3.0.0/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec2875944840/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2875944840.dir/build.make CMakeFiles/cmTryCompileExec2875944840.dir/build
make[1]: Entering directory `/opt/freeglut-3.0.0/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /opt/freeglut-3.0.0/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2875944840.dir/CheckFunctionExists.c.o
/usr/bin/cc -Wall -pedantic -DCHECK_FUNCTION_EXISTS=XParseGeometry -o CMakeFiles/cmTryCompileExec2875944840.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec2875944840
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2875944840.dir/link.txt --verbose=1
/usr/bin/cc -Wall -pedantic -DCHECK_FUNCTION_EXISTS=XParseGeometry CMakeFiles/cmTryCompileExec2875944840.dir/CheckFunctionExists.c.o -o cmTryCompileExec2875944840 -rdynamic -lm
CMakeFiles/cmTryCompileExec2875944840.dir/CheckFunctionExists.c.o: In function `main':
CheckFunctionExists.c:(.text+0x15): undefined reference to `XParseGeometry'
collect2: error: ld returned 1 exit status
make[1]: Leaving directory `/opt/freeglut-3.0.0/CMakeFiles/CMakeTmp'
make[1]: *** [cmTryCompileExec2875944840] Error 1
make: *** [cmTryCompileExec2875944840/fast] Error 2
I don't know how to find a solution for myself so i ask it here.
Thanks in advance
usbhid.h : Please install ``libusbhid-dev´´ : $ sudo apt-get install libusbhid-dev
I'm running into the following error while compiling C++ application using Intel MPI:
/u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include/mpicxx.h:95:2: error: #error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
As per Intel's solution, I've tried adding -DMPICH_IGNORE_CXX_SEEK and -DMPICH_SKIP_MPICXX during compiling time, i.e.
make CPPFLAGS="-DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX"
I'm not sure if I've done the above step correctly, because the error persisted even with the flag added. If I added it wrong, can someone please tell me the right way to add the options at compile time?
Edit: I added #include "mpi.h" and #include at the top of communicator.h and make no longer shows communicator.h as part of the problem. However, for main.cu the problem persisted.
Full error is below:
$ make VERBOSE=1
/usr/bin/cmake -H/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874 -B/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/CMakeFiles /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/u/project/miao/y1lo/camera/ptychography-sharp-dev-73eeb9f85874/build'
make -f src/CMakeFiles/sharp.dir/build.make src/CMakeFiles/sharp.dir/depend
make[2]: Entering directory `/u/project/miao/y1lo/camera/ptychography-sharp-dev-73eeb9f85874/build'
/usr/bin/cmake -E cmake_progress_report /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/CMakeFiles 4
[ 3%] Building NVCC (Device) object src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o
cd /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir && /usr/bin/cmake -E make_directory /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//.
cd /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir && /usr/bin/cmake -D verbose:BOOL=1 -D build_configuration:STRING=release -D generated_file:STRING=/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o -D generated_cubin_file:STRING=/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o.cubin.txt -P /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//sharp_generated_main.cu.o.cmake
-- Removing /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o
/usr/bin/cmake -E remove /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o
-- Generating dependency file: /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//sharp_generated_main.cu.o.NVCC-depend
/u/local/cuda/5.5/bin/nvcc -M -D__CUDACC__ /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/src/main.cu -o /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//sharp_generated_main.cu.o.NVCC-depend -ccbin /usr/bin/cc -m64 -Dsharp_EXPORTS -Xcompiler ,\"-fPIC\",\"-O3\",\"-DNDEBUG\" -gencode=arch=compute_20,code=compute_20 -gencode=arch=compute_35,code=compute_35 -DBOOST_DISABLE_ASSERTS -DNVCC -I/u/local/cuda/5.5/include -I/u/home/y/y1lo/project-miao/camera/cusplibrary-0.5.1 -I/u/local/cuda/5.5/include -I/usr/include -I/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/src -I/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/include -I/u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include -I/u/home/y/y1lo/usr/local/hdf5/include -I/u/local/gcc/4.4.4/libs/fftw/3.2.2/include
In file included from /u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include/mpi.h:1279,
from /u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/src/main.cu:1:
/u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include/mpicxx.h:95:2: error: #error "SEEK_SET is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
/u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include/mpicxx.h:99:2: error: #error "SEEK_CUR is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
/u/local/compilers/intel-cs/2013.0.028/mpi/intel64/include/mpicxx.h:104:2: error: #error "SEEK_END is #defined but must not be for the C++ binding of MPI. Include mpi.h before stdio.h"
CMake Error at sharp_generated_main.cu.o.cmake:206 (message):
Error generating
/u/home/y/y1lo/project-miao/camera/ptychography-sharp-dev-73eeb9f85874/build/src/CMakeFiles/sharp.dir//./sharp_generated_main.cu.o
make[2]: *** [src/CMakeFiles/sharp.dir/./sharp_generated_main.cu.o] Error 1
make[2]: Leaving directory `/u/project/miao/y1lo/camera/ptychography-sharp-dev-73eeb9f85874/build'
make[1]: *** [src/CMakeFiles/sharp.dir/all] Error 2
make[1]: Leaving directory `/u/project/miao/y1lo/camera/ptychography-sharp-dev-73eeb9f85874/build'
make: *** [all] Error 2
I am trying to compile cocos2d-x 3.5 on openSUSE 13.2 and i get the following error in .log file:
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTryCompileExec846787943/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec846787943.dir/build.make CMakeFiles/cmTryCompileExec846787943.dir/build
gmake[1]: Entering directory '/home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec846787943.dir/CheckSymbolExists.c.o
/usr/bin/cc -fno-exceptions -std=c99 -o CMakeFiles/cmTryCompileExec846787943.dir/CheckSymbolExists.c.o -c /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec846787943
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec846787943.dir/link.txt --verbose=1
/usr/bin/cc -fno-exceptions -std=c99 CMakeFiles/cmTryCompileExec846787943.dir/CheckSymbolExists.c.o -o cmTryCompileExec846787943 -rdynamic
CMakeFiles/cmTryCompileExec846787943.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec846787943.dir/build.make:88: recipe for target 'cmTryCompileExec846787943' failed
gmake[1]: *** [cmTryCompileExec846787943] Error 1
gmake[1]: Leaving directory '/home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp'
Makefile:118: recipe for target 'cmTryCompileExec846787943/fast' failed
gmake: *** [cmTryCompileExec846787943/fast] Error 2
File /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTryCompileExec3838281423/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3838281423.dir/build.make CMakeFiles/cmTryCompileExec3838281423.dir/build
gmake[1]: Entering directory '/home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3838281423.dir/CheckFunctionExists.c.o
/usr/bin/cc -fno-exceptions -std=c99 -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3838281423.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3838281423
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3838281423.dir/link.txt --verbose=1
/usr/bin/cc -fno-exceptions -std=c99 -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3838281423.dir/CheckFunctionExists.c.o -o cmTryCompileExec3838281423 -rdynamic -lpthreads
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTryCompileExec3838281423.dir/build.make:88: recipe for target 'cmTryCompileExec3838281423' failed
gmake[1]: *** [cmTryCompileExec3838281423] Error 1
gmake[1]: Leaving directory '/home/humman/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build/CMakeFiles/CMakeTmp'
Makefile:118: recipe for target 'cmTryCompileExec3838281423/fast' failed
gmake: *** [cmTryCompileExec3838281423/fast] Error 2
I installed the dependencies and libraries manually, but I still get this error. Does anyone know whats going on?
Note: when i try to compile, the first 2 lines are:
~/android-dev/cocos2d-x-3.5/cocos2d-x-3.5/build/linux-build> cmake ../..
CMake Error at CMakeLists.txt:35 (cmake_policy):
Policy "CMP0054" is not known to this version of CMake.
Thanks :D
Solved, I just did comment this lines out in the CMakeList.txt file
#if(CMAKE_VERSION VERSION_GREATER 3)
#cmake_policy(SET CMP0054 NEW)
#endif()
but now, when I use make command (No matter where, using NetBeans or terminal) it ends with this error at 98% (after about 15mins compiling)
[ 98%] Built target cocos2d
[ 98%] Built target MyGame_CORE_PRE_BUILD
MyGame_PRE_BUILD ...
[ 98%] Built target MyGame_PRE_BUILD
Linking CXX executable bin/MyGame
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: lib/libcocos2d.a(CCSpriteFrameCache.cpp.o): undefined reference to symbol '_ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_##GLIBCXX_3.4'
/usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/MyGame.dir/build.make:164: recipe for target 'bin/MyGame' failed
make[2]: *** [bin/MyGame] Error 1
CMakeFiles/Makefile2:64: recipe for target 'CMakeFiles/MyGame.dir/all' failed
make[1]: *** [CMakeFiles/MyGame.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Any idea??
Solved, If anyone has the same problem, just use cmake with the argument -pthread and then you will be able to build using make. If you wanna build using NetBeans, u have to leave only the -G "Unix..." argument and add in the CMakefile.txt the line: set(-pthread) --I did add it at the top-- and thats all, it should be everything ok :D cheers!
This appears to be a long-standing CMake bug. Something else is going wrong, CMake gets confused, and reports this spurious problem instead of the real error.
Look for "thread" in your CMakeLists.txt file and temporarily remove that.