首页 > 解决方案 > 如何解决linux中GLFW应用静态编译的问题?

问题描述

这是我的应用程序编译命令。

# inside file grun.sh
g++ $1  -pthread -static -o  glapp -lglut -lGLU -lGL -lglfw && ./glapp $2 $3 $4 $5 $6 $7 $8 && rm ./glapp

使用我的应用程序文件运行上述命令时。

$ grun Myapplication.cpp

得到错误

/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lglfw
collect2: error: ld returned 1 exit status

虽然没有选项它运行良好-static,但我想让我的应用程序静态编译,请帮助我该怎么做?

标签: c++linuxstaticglfwglu

解决方案


推荐阅读