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:
if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GLFW"), _T("glfw3.h"), _T("GLFW's include"))) return false;
Line 55:
if (!VerifyLibFile(dir_nomacro_lib, _T("glfw3"), _T("GLFW's"))) return false;
Line 95:
project.AddLinkLib(_T("glfw3"));
6) Save the file
7) File->New->Project->GFLW Project->Ok->Next
8) "Please select GLFWs location":
$(#glfw)
9) In step 2 i Installed the library to
So if you have to set the global variable:
so i set the "base" to
"include" to
G:\glfw-3.2.1\install\include
and "lib" to
G:\glfw-3.2.1\install\lib
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:
project_folder/glad/inlcude/glad/glad.h
and
project_folder/glad/src/glad/glad.c
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->
17) Ok all
18) Project->Build
19) Project->Run
20 Enjoy a spinning triangle ;)
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...
Well, It's not Ubuntu related, because I installed glfw from source.
Anyway, on line49 I have:
if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GL"), _T("glfw.h"), _T("GLFW's include"))) return false;
I already have adjusted the second T() from "glfw3.h" to "glfw.h" but the other two T, I don't know to what they make reference to.
On line 55:
if (!VerifyLibFile(dir_nomacro_lib, _T("glfw"), _T("GLFW's"))) return false;
Also don't know to what the two T() are referring to.
And finally on line 95
project.AddLinkLib(_T("glfw"));
Don't know what this T is referring to either
The include dir has a subdir called "GL" where there is the header. The lib dir has a subdir called x11 where libglfw.a and libglfw.so are.
Any ideas of how to set them up?
if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GL"), _T("glfw.h"), _T("GLFW's include"))) return false;
This line searches in
dir_nomacro_inc + wxFILE_SEP_PATH + _T("GL")
for the file
is the path you enter in the dialog
is the file path separator for your operating system
so if you enter the path
/media/34GB/demos/glfw-2.7.9/include/
the wizard will search for the file
/media/34GB/demos/glfw-2.7.9/include/GL/glfw.h
if (!VerifyLibFile(dir_nomacro_lib, _T("glfw"), _T("GLFW's"))) return false;
The same for the library: This function search for the library in the library folder. This function is this:
function SilentVerifyLibFile(dir, file)
{
return ( IO.FileExists(dir + wxFILE_SEP_PATH + file)
|| IO.FileExists(dir + wxFILE_SEP_PATH + file + _T(".a"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + file + _T(".dll.a"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + file + _T(".lib"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file)
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file + _T(".a"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file + _T(".dll.a"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file + _T(".lib"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file + _T(".la"))
|| IO.FileExists(dir + wxFILE_SEP_PATH + _T("lib") + file + _T(".so")) );
}
so if the path is right it should find the library ,because it searches for . Maybe you have to add the X11 folder to the library directory.
This line:
project.AddLinkLib(_T("glfw"));
adds the library with the name glfw to the project. The compiler will search by default also for . It adds automatically the lib and .a So you do not have to do it by yourself.
The easiest would be to abandon the wizard: Create a hello world c project and add the include directories in Project->Build options->Select your project name on the left->Search directories->Compiler->Add the folder where the include file can be found
The same for the library: Project->Build options->Select your project name on the left->Linker->Add library
Anyway it would be nice if you help to fix the wizard. Probably i will find some time the next week to try this on ubuntu. Where did you get the code from?
Ok, here the steps i do:
1) Download https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip
2) extract it to /home/bluehazzard/programming/glfw
3) run cmake-gui
4) select source directory to /home/bluehazzard/programming/glfw
5) select output directory to /home/bluehazzard/programming/glfw/build
6) Set CMAKE_INSTALL_PREFIX to /home/bluehazzard/programming/glfw/install
7) Configure
8) make
9) make install
10) Start codeblocks
11) Fix the wizard with the code below
////////////////////////////////////////////////////////////////////////////////
//
// GLFW project wizard
//
////////////////////////////////////////////////////////////////////////////////
// globals
GlfwPathDefault <- _T("$(#glfw)");
GlfwPathDefaultInc <- _T("$(#glfw.include)");
GlfwPathDefaultLib <- _T("$(#glfw.lib)");
GlfwPath <- _T("");
function BeginWizard()
{
local intro_msg = _T("Welcome to the new GLFW project wizard!\n\n" +
"This wizard will guide you to create a new project\n" +
"using the GLFW OpenGL extensions.\n\n" +
"When you 're ready to proceed, please click \"Next\"...");
local glfwpath_descr = _T("Please select the location of GLFW on your computer.\n" +
"This is the top-level folder where GLFW was installed (unpacked).\n" +
"To help you, this folder must contain the subfolders\n" +
"\"include\" and \"lib\".");
Wizard.AddInfoPage(_T("GlfwIntro"), intro_msg);
Wizard.AddProjectPathPage();
Wizard.AddGenericSelectPathPage(_T("GlfwPath"), glfwpath_descr, _T("Please select GLFW's location:"), GlfwPathDefault);
Wizard.AddCompilerPage(_T(""), _T("*"), true, true);
}
////////////////////////////////////////////////////////////////////////////////
// GLFW's path page
////////////////////////////////////////////////////////////////////////////////
function OnLeave_GlfwPath(fwd)
{
if (fwd)
{
local dir = Wizard.GetTextControlValue(_T("txtFolder")); // txtFolder is the text control in GenericSelectPathPage
local dir_nomacro = VerifyDirectory(dir);
if (dir_nomacro.IsEmpty())
return false;
// verify include dependencies
local dir_nomacro_inc = GetCompilerIncludeDir(dir, GlfwPathDefault, GlfwPathDefaultInc);
if (dir_nomacro_inc.IsEmpty())
return false;
if (!VerifyFile(dir_nomacro_inc + wxFILE_SEP_PATH + _T("GLFW"), _T("glfw3.h"), _T("GLFW's include"))) return false;
// verify library dependencies
local dir_nomacro_lib = GetCompilerLibDir(dir, GlfwPathDefault, GlfwPathDefaultLib);
if (dir_nomacro_lib.IsEmpty())
return false;
if (!VerifyLibFile(dir_nomacro_lib, _T("glfw3"), _T("GLFW's"))) return false;
GlfwPath = dir; // Remember the original selection.
local is_macro = _T("");
// try to resolve the include directory as macro
is_macro = GetCompilerIncludeMacro(dir, GlfwPathDefault, GlfwPathDefaultInc);
if (is_macro.IsEmpty())
{
// not possible -> use the real inc path we had computed instead
GlfwPathDefaultInc = dir_nomacro_inc;
}
// try to resolve the library directory as macro
is_macro = GetCompilerLibMacro(dir, GlfwPathDefault, GlfwPathDefaultLib);
if (is_macro.IsEmpty())
{
// not possible -> use the real lib path we had computed instead
GlfwPathDefaultLib = dir_nomacro_lib;
}
}
return true;
}
// return the files this project contains
function GetFilesDir()
{
return _T("glfw/files");
}
// setup the already created project
function SetupProject(project)
{
// set project options
project.AddIncludeDir(GlfwPathDefaultInc);
project.AddLibDir(GlfwPathDefaultLib);
// add link libraries
project.AddLinkLib(_T("glfw3"));
if (PLATFORM == PLATFORM_MSW)
{
project.AddLinkLib(_T("opengl32"));
project.AddLinkLib(_T("glu32"));
project.AddLinkLib(_T("gdi32"));
}
else
{
project.AddLinkLib(_T("GL"));
project.AddLinkLib(_T("GLU"));
project.AddLinkLib(_T("pthread"));
project.AddLinkLib(_T("Xxf86vm"));
}
// enable compiler warnings (project-wide)
WarningsOn(project, Wizard.GetCompilerID());
// Debug
local target = project.GetBuildTarget(Wizard.GetDebugName());
if (!IsNull(target))
{
target.SetTargetType(ttConsoleOnly); // ttConsoleOnly: console for debugging
target.SetOutputFilename(Wizard.GetDebugOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
target.SetWorkingDir(GlfwPath + _T("/bin"));
// enable generation of debugging symbols for target
DebugSymbolsOn(target, Wizard.GetCompilerID());
}
// Release
target = project.GetBuildTarget(Wizard.GetReleaseName());
if (!IsNull(target))
{
target.SetTargetType(ttExecutable); // ttExecutable: no console
target.SetOutputFilename(Wizard.GetReleaseOutputDir() + Wizard.GetProjectName() + DOT_EXT_EXECUTABLE);
target.SetWorkingDir(GlfwPath + _T("/bin"));
// enable optimizations for target
OptimizationsOn(target, Wizard.GetCompilerID());
}
return true;
}
12) Create new project with the wizard
13) Set the search path for glfw to /home/bluehazzard/programming/glfw/install
14) The wizard should finish without problems
15) Make the changes as described above