Author Topic: Problem trying to static link glew in Linux.  (Read 221 times)

Offline colt

  • Single posting newcomer
  • *
  • Posts: 9
Problem trying to static link glew in Linux.
« on: September 06, 2019, 08:38:02 pm »
Hello. I decided to try to build an OGL application with all its required libraries in its executable file. So I added "-static" to "other link options" on on the "linker settings" tab of. This all on "settings" and then on "compiler and debugger" When trying to build my program in a static way, with means glew has to be in it, I received
Quote
/usr/bin/ld: attempted static link of dynamic object `/media/34GB/Arquivos-de-Programas-Linux/glew-2.1.0/lib/libGLEW.so'

I guess the problem is that codeblocks is trying to use a dynamic library instead a static, .a one, right?

This time I went to my project, right clicked on it, then clicked on "build options" When to the project "linker settings" and saw there the .so glew library file. Added the static, .a version and tried to rebuild the project. Same error. Removed the dynamic library from there, letting only the static version (and a dynamic glfw library) file. Tried once more. The same error message repeated!

So am I correct to believe that the solution is to make Codeblocks look for "libGLEW.a" ?

If so, how to do it? If not, what is the solution? Thanks for the support.

P.S: Using absolute paths to the library files.
« Last Edit: September 06, 2019, 08:39:36 pm by colt »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2542