質問

When I tried to run an installer that uses GLEW as one of its dependencies, I got:

fatal error: GL/glew.h: No such file or directory

Downloaded glew1.10 from the official site and installed according to given instructions.
After that I got the same error again- did some research and copied glew.h to /usr/include/GL/glew.h. Ran the installer again and this time got:

/usr/bin/ld: error: cannot find -lGLEW

To my understanding this is a a common error in Linux for many projects and many libraries, probably I should copy some files from the source folder or add some path to an environment variable, what should i do?
I know that there are apt-get packages- libglew1.6-dev and libglew1.6, but its built upon glew1.6, which works but is probably out-dated for what i'm trying to build.
The automatic installer is node.js's npm, and what causes this error is trying to install node-webgl module.

役に立ちましたか?

解決

Solved.
As it turned out, the installation seems to have placed the needed files inside /usr/lib64, and the linker searched for those files inside /usr/lib/ which probably is the right behavior in most cases.
Since i'm not familiar with node.js's npm (and with linking in general), my fix was as follows:

sudo cp /usr/lib64/libGLEW* /usr/lib/
sudo cp /usr/lib64/pkgconfig/* /usr/lib/pkgconfig/

Meaning, I reconstructed the same hirarchy inside the /usr/lib folder. This is probably not a best practice, but it works.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top