繁体   English   中英

无法弄清楚如何在 linux Mint 上安装 C++ 库 (GLUI)

[英]Can't figure out how to install a C++ library (GLUI) on linux Mint

我一直在尝试在我的 Linux mint 发行版上安装这个: https ://github.com/libglui/glui。 我通常使用命令行安装东西,并且是手动安装库的新手。 基本上,我下载了 Github 存储库,运行了 make 文件,但不知道从那里去哪里。 他们并没有真正提供我能找到的任何说明。

基本上我运行了 make 它生成了一个 .a 文件。 我将此 .a 文件移动到我的 /usr/lib/x86_64-linux-gnu 文件夹中。 现在当我运行这个时:

g++ -o test test.cpp /usr/lib/x86_64-linux-gnu/libOpenCL.so -lGL -lGLU -lglut -lglui -lm -fopenmp

而不是得到我以前的错误(/usr/bin/ld 找不到 -lgui),我得到了这堵厄运之墙:

/usr/bin/ld: /tmp/ccvdD4zb.o: in function `InitGlui()':
sample.cpp:(.text+0x10d4): undefined reference to `GLUI_Master_Object::create_glui(char*, long, int, int)'
/usr/bin/ld: sample.cpp:(.text+0x10f4): undefined reference to `GLUI::add_statictext(char*)'
/usr/bin/ld: sample.cpp:(.text+0x112b): undefined reference to `GLUI::add_checkbox(char*, int*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x1153): undefined reference to `GLUI::add_checkbox(char*, int*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x117b): undefined reference to `GLUI::add_checkbox(char*, int*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x1196): undefined reference to `GLUI::add_panel(char*, int)'
/usr/bin/ld: sample.cpp:(.text+0x11c7): undefined reference to `GLUI::add_rotation_to_panel(GLUI_Panel*, char*, float*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x122c): undefined reference to `GLUI::add_translation_to_panel(GLUI_Panel*, char*, int, float*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x1295): undefined reference to `GLUI::add_translation_to_panel(GLUI_Panel*, char*, int, float*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x12fe): undefined reference to `GLUI::add_translation_to_panel(GLUI_Panel*, char*, int, float*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x1335): undefined reference to `GLUI::add_panel(char*, int)'
/usr/bin/ld: sample.cpp:(.text+0x135f): undefined reference to `GLUI::add_button_to_panel(GLUI_Panel*, char*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x13a0): undefined reference to `GLUI::add_button_to_panel(GLUI_Panel*, char*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x13e1): undefined reference to `GLUI::add_button_to_panel(GLUI_Panel*, char*, int, void (*)(int))'
/usr/bin/ld: sample.cpp:(.text+0x1422): undefined reference to `GLUI::add_button_to_panel(GLUI_Panel*, char*, int, void (*)(int))'
collect2: error: ld returned 1 exit status

显然,我需要对我下载并运行 make 文件的那个 repo 做其他事情,我只是不知道是什么,似乎无法在任何地方找到答案,请帮忙!

如果您查看项目历史记录,提交 936b3d7e6a42c6eab0eecc191861b0a98fa7fc30(2017 年 6 月 30 日)将所有提到的函数替换为采用const GLUI_String&的函数。

您显然在某处引用了旧界面的 glui.h 文件。 您应该将glui.h 文件从 repo复制到/usr/local/include/GL/glui.h并将-I/usr/local/include到您的编译标志中。 这将确保选择与库匹配的标头,并且您不会收到这些错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM