Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: colt on September 06, 2019, 08:38:02 pm

Title: Problem trying to static link glew in Linux.
Post by: colt 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.
Title: Re: Problem trying to static link glew in Linux.
Post by: BlueHazzard on September 07, 2019, 12:55:07 am
Some information is missing:
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F