Search code examples
c++linuxopenglcmakefreeglut

CMake + freeglut3: cannot find usbhid.h


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


Solution


  • usbhid.h : Please install ``libusbhid-dev´´ : $ sudo apt-get install libusbhid-dev