User forums > Using Code::Blocks

Codeblocks not locating glfw libs even after I pointing the path to it.

(1/3) > >>

colt:
Hello, I tried to use the wizard to start a glfw project, and when I do it, it says at one point :


--- Quote ---.......Please select the location of GLFW's location
--- Quote ---
When I click the "..." button, before actually taking me to select the place, it opens a Window to adjust variable settings. Following what I learned from a webpage (http://www.kerrywong.com/2008/07/12/codeblocks-settings-for-qt-development/) to set up QT support in another project, the "base" and "include" fields were adjusted to point to the dir /.../glfw-2.7.9/include/GL. There there is the "glfw.h" header file. The field "lib" were adjusted to point to /.../glfw-2.7.9/lib/x11. There there is the "libglfw.a" and "libglfw.so"

After adjusting it, codelblocks opened the small window to actually select glfw's location and then I told it to look for it in  /..../glfw-2.7.9.

When I do that, Codeblocks tells me this:
--- Quote ---the path you entered seems valid, but this wizard can't locate the following GLFW's library file: glfw in it (also tried prepending lib and appending .a and .lib)
--- End quote ---

Isn't the problem is that he is only looking precisely for something called "glfw.a" or "glfw.lib" when should be looking for "libglfw.a" or "libglfw.so" ? If that's the case, how can I solve it? If it's not, what is the issue and how should I deal with it?

Thanks for your time.
--- End quote ---

--- End quote ---

BlueHazzard:
Does the wizard concludes? Is the project generated?
If yes, then try to build it. If it fails post the build log here as described in this faq: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

The wizard is not the brightest and probably needs some updates...
Also giving your operating system would be nice

BlueHazzard:
Ok, i did a quick test on windows, and there is a lot to change...
I try to explain them here step by step. Probably there will be an update to fix the wizard.

Windows 7 mingw
1) I downloaded this https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
2) Compiled it with cmake and mingw compiler
3) Start codeblocks
4) File->New->Project
5) Right click on GLFW Project->Edit this script
Line 49:

--- Code: ---if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GLFW"), _T("glfw3.h"), _T("GLFW's include"))) return false;
--- End code ---
Line 55:

--- Code: ---if (!VerifyLibFile(dir_nomacro_lib, _T("glfw3"), _T("GLFW's"))) return false;
--- End code ---
Line 95:

--- Code: ---    project.AddLinkLib(_T("glfw3"));
--- End code ---
6) Save the file
7) File->New->Project->GFLW Project->Ok->Next
8) "Please select GLFWs location":

--- Quote ---$(#glfw)
--- End quote ---
9) In step 2 i Installed the library to

--- Code: ---G:\glfw-3.2.1\install
--- End code ---
So if you have to set the global variable:
so i set the "base" to

--- Code: ---G:\glfw-3.2.1\install
--- End code ---
"include" to

--- Code: ---G:\glfw-3.2.1\install\include
--- End code ---
and "lib" to

--- Code: ---G:\glfw-3.2.1\install\lib
--- End code ---
10) Finish the wizard. It should complete

The created example code is outdated, so we have to create our own example:
11) From the gflw source folder copy the content of "G:\glfw-3.2.1\examples\simple.c" over the content of main.cpp of the project
12) I don't know exactly why, but we need glad:
I used the zip archive of this link http://glad.dav1d.de/#profile=compatibility&specification=gl&api=gl%3D4.6&api=gles1%3Dnone&api=gles2%3Dnone&api=glsc2%3Dnone&language=c&loader=on
13) Extract it in your project folder so you will have the folowing structure:

--- Code: ---project_folder/glad/inlcude/glad/glad.h
--- End code ---
and

--- Code: ---project_folder/glad/src/glad/glad.c
--- End code ---
14) Copy the file "G:\glfw-3.2.1\deps\linmath.h" to your project folder
15) Add the files to your project: Project->Add files: glad/src/glad.c, and linmath.h
16) Add the include folder search path to the project: Project->Build options->Select the project name on the left->Search directories->Compiler->Add->

--- Code: ---glad\include
--- End code ---
17) Ok all

18) Project->Build
19) Project->Run
20 Enjoy a spinning triangle ;)



colt:

--- Quote ---Does the wizard concludes? Is the project generated?
If yes, then try to build it. If it fails post the build log here as described in this faq: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

The wizard is not the brightest and probably needs some updates...
Also giving your operating system would be nice
--- End quote ---

No, it did not conclude unfortunately.  When I clicked "next" it forced me to set the variables. After that it opens the selection window to select the GLFW's location. After doing that, it ends showing the small error window and it became paralyzed (neither the "next" button or the "..." button that selects the location answer anymore). At that point The "X" button on both windows also does not answer anymore. (I am referring to exit "x" on both the gl project window and on the codeblocks main window) forcing me to end codeblocks through command line.

I ask apologize for forgetting to mention the OS. Unfortunately it's not Windows, it's Linux, Ubuntu 10.04 with glfw 2.7.9.

Anyway I changed the 3 lines on the script file, then on the global variable setting, I set the "base" variable to /media/34GB/demos/glfw-2.7.9, the "include" variable to /media/34GB/demos/glfw-2.7.9/include/GL (where there is "glfw.h") and finally the "lib" variable to /media/34GB/demos/glfw-2.7.9/lib/X11 (where libglfw.a and libglfw.so are).

If I set the "include" variable to /media/34GB/demos/glfw-2.7.9/include/ and the "lib" variable to /media/34GB/demos/glfw-2.7.9/lib does not make any difference.

After all that, I received a 

--- Quote ---The path you entered seems valid, but this wizard
can't locate the following GLFW's include file:
glfw3.h in it.
--- End quote ---
I changed it to "glfw.h on line 49 and problem persists (of course, now complaining about "glfw.h"

Have to change something on the other lines?

P.S: Glfw name  on the project wizard became red after the script modifications

BlueHazzard:

--- Quote ---P.S: Glfw name  on the project wizard became red after the script modifications
--- End quote ---
this indicates that you have modified the script


--- Quote ---I ask apologize for forgetting to mention the OS. Unfortunately it's not Windows, it's Linux, Ubuntu 10.04 with glfw 2.7.9.
--- End quote ---
I can not help with this at the moment...
But obviously you have to change the settings so they work with your installation... If the library is called glfw2 you have to change the line in the script accordingly. Changing to glfw3 when the library is called glfwAA does not work as you have found out. I do not know how the library is called on ubuntu...

I made a quick look in the script and there are no difference between windows and unix, so you simply have to change the lines i gave you above with the right names and it should work...

Navigation

[0] Message Index

[#] Next page

Go to full version