为什么构建glfw失败并给我错误?

时间:2020-07-09 09:51:38

标签: ubuntu-18.04 glfw

我需要为应用程序Pulp Labs构建glfw。首先,我sudo-apt安装了它。这给了我以下错误:

player - [INFO] numexpr.utils: Note: NumExpr detected 64 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
player - [INFO] numexpr.utils: NumExpr defaulting to 8 threads.
player - [INFO] launchables.player: Session setting are from a  different version of this app. I will not use those.
player - [ERROR] launchables.player: Process player_drop crashed with trace:
Traceback (most recent call last):
  File "/home/fiza/anaconda3/envs/pupil_labs/pupil/pupil_src/launchables/player.py", line 768, in player_drop
    window = glfw.glfwCreateWindow(w, h, "Pupil Player")
  File "/home/fiza/anaconda3/envs/pupil_labs/pupil/pupil_src/shared_modules/glfw.py", line 566, in glfwCreateWindow
    raise Exception(f"GLFW window failed to create: {glfwGetError()}")
  File "/home/fiza/anaconda3/envs/pupil_labs/pupil/pupil_src/shared_modules/glfw.py", line 512, in glfwGetError
    _glfwGetError = _glfw.glfwGetError
  File "/home/fiza/anaconda3/envs/pupil_labs/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/home/fiza/anaconda3/envs/pupil_labs/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libglfw.so.3: undefined symbol: glfwGetError

建议我安装它并从头开始构建最新版本。因此,我使用以下方法删除了此软件包:

sudo apt autoremove libglfw-dev
sudo apt-get purge --auto-remove libglfw-dev

后来,我遵循this post(包括这篇文章中的建议)来构建glfw。

它工作正常,但在测试编译时出现此错误:

g++ -std=c++11 -c main.cpp
g++: error: main.cpp: No such file or directory
g++: fatal error: no input files
compilation terminated.

我正在学习,所以我相对较新。尽管我过去在Mac上使用命令行浏览文件夹和下载简单程序的经验,但我只是在去年才开始使用它在Ubuntu OS上构建程序和软件包。

编辑:运行以下代码来检查库,表明glfw3没有正确下载(如果有的话)。

pkg-config --static --libs glfw3
-L/usr/local/lib -lglfw3 -lrt -lm -ldl -lX11 -lpthread -lxcb -lXau -lXdmcp

更新(8月5日):两周前,我使用 sudo apt-get purge --auto-remove 删除了先前sudo apt安装的glfw文件(* .so文件以及开发文件)。最近,我重新启动了终端和计算机。我直接打开需要glfw的程序。它可以在我的虚拟环境中工作。

对于上述错误,建议我未下载测试文件或未正确链接测试文件。因为我的程序仍然有效,所以我不需要检验该理论。

0 个答案:

没有答案