CMake + freeglut3:找不到 usbhid.h

CMake + freeglut3: cannot find usbhid.h

系统:我在 Max OS 10.11.3 系统上使用 Linux Mint 17.3 作为 VB-Guest。

问题:我想编译freeglut3.0.0

问题:cmake 给我一个致命错误:usbhid.h:没有那个文件或目录

您好,

问题是,即使安装了所有依赖项后,我也无法在我的系统上找到该文件。经过研究,我发现它与某些 USB 驱动程序有关。难道它与没有 "actual" usb 硬件的 VB-系统有关? 或者有没有我缺少的包裹。

我安装了 libgl1-mesa-dev、libx11-dev、libxrandr-dev 和 libxi-dev

这里附上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

我不知道如何为自己找到解决方案,所以我在这里问。

提前致谢


usbhid.h:请安装“libusbhid-dev”:$ sudo apt-get install libusbhid-dev