perthblank
perthblank

Reputation: 21

cannot find -lglew for opengl in ubuntu

I already installed libglew and the dev but still cannot find -glew when compiling

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

also I've written in code like

#include<GL/glew.h>
#pragma comment(lib, "glew32.lib")

what should I do next?

Upvotes: 2

Views: 9618

Answers (2)

starrify
starrify

Reputation: 14781

As far as I know the package glew brings libraries named libGLEW.a and libGLEW.so, so instead of -lglew you shall try -lGLEW.

Also #pragma comment(lib, "glew32.lib") is the way that Microsoft VS compilers do with libraries, and is expected to have no effect with GNU/Linux toolchains like gcc or clang.

Upvotes: 6

Gavin Simpson
Gavin Simpson

Reputation: 2832

If not pathed then just add the full path to the filename of the lib. first make sure that the lib really exists.

Upvotes: 0

Related Questions