Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: SuperBoi45 on April 05, 2014, 11:44:12 pm

Title: GLFW Project: "Please select GLFW's location"
Post by: SuperBoi45 on April 05, 2014, 11:44:12 pm
Hi all. I'm trying to make a GLFW project for the first time but when I try to set it up CodeBlocks asks me for the location of GLFW. This is what is says here:

(http://i.gyazo.com/b5a09361d3bc257765029a7c2a156377.png)

The thing is, I don't know what it is asking me. I downloaded glut but what do I have to put in the text box? Also, what is "$(#glfw)"?
Title: Re: GLFW Project: "Please select GLFW's location"
Post by: EnterTheNameHere on April 06, 2014, 02:18:40 am
GLFW (I don't know if you are using it, since you mentioned only glut) can be downloaded here - http://www.glfw.org/

Code::Blocks is asking for the directory where you have extracted the GLFW archive. You can navigate to the path and set the location directly in the wizard - or there is a second way, set it with global variables (http://wiki.codeblocks.org/index.php?title=Global_compiler_variables).

You can find global varibles in Code::Blocks -> Settings -> Global variables, which opens an editor for global variables. You can create a new variable (the second row New button), and call it "glfw", or "boost" or any other name for your favourite libraries/packages (http://wiki.codeblocks.org/index.php?title=Recommended_global_variables). Then you just set the base directory location where the library/package can be found.
You can then use the variable expansion (http://wiki.codeblocks.org/index.php?title=Variable_expansion) to let Code::Blocks fill up the paths for you. Example can tell it better:
You create new global variable named "glfw". You set base to the directory where you extracted the archive, let's say "c:/libraries/GLFW" (or similar linux path), and now you can use $(#glfw). It tells Code::Blocks use variable expansion, and use global variable glfw. You might then see (put) $(#glfw.include) in project's includes. Code::Blocks will automagically expands it to "c:/libraries/GLFW/include" when it will pass it to compiler. For more info about the global variables see http://wiki.codeblocks.org/index.php?title=Global_compiler_variables