Issue Compiling Jason L. McKesson's OpenGl Tutorial

Hello, I’m having a problem building the SDK. I have done the following as the tutorial commands:
Type premake4 plat <— Where plat is the platform. In my case gmake since I’m using mingw under windows.

premake4 gmake

Then I proceeded to make the build for debug and release and got the following errors respectively:

make config=debug
"==== Building glload (debug) ===="
"==== Building glimg (debug) ===="
"==== Building glfw (debug) ===="
"==== Building freeglut (debug) ===="
freeglut_callbacks.c
In file included from src/freeglut_callbacks.c:29:0:
src/freeglut_internal.h:32:24: fatal error: config.h: No such file or directory
compilation terminated.
Makefile:152: recipe for target 'obj/Debug/freeglut_callbacks.o' failed
mingw32-make[1]: *** [obj/Debug/freeglut_callbacks.o] Error 1
Makefile:28: recipe for target 'freeglut' failed
mingw32-make: *** [freeglut] Error 2
make config=release
"==== Building glload (release) ===="
"==== Building glimg (release) ===="
"==== Building glfw (release) ===="
"==== Building freeglut (release) ===="
freeglut_callbacks.c
In file included from src/freeglut_callbacks.c:29:0:
src/freeglut_internal.h:32:24: fatal error: config.h: No such file or directory
compilation terminated.
Makefile:152: recipe for target 'obj/Release/freeglut_callbacks.o' failed
mingw32-make[1]: *** [obj/Release/freeglut_callbacks.o] Error 1
Makefile:28: recipe for target 'freeglut' failed
mingw32-make: *** [freeglut] Error 2

I specificially don’t know what it means by src/freeglut_internal.h:32:24: fatal error: config.h as I downloaded both premake and the unofficial SDK from their official sites. I also wanted to note I did add premake to my path.

Any suggestions/advice on how to fix this problem would be greatly appreciated.

Try replacing the FreeGLUT.lua file in the freeglut directory with this one.

if(_ACTION == "gmake") then
	if(os.get() == "linux" or os.get() == "bsd") then
		os.execute("sh ./configure");
	end
end

project "freeglut"
	kind "StaticLib"
	language "c"
	includedirs {"include"}
	targetdir "lib"
	files {"src/*.c"};
	
	defines {"FREEGLUT_STATIC", "_LIB", "FREEGLUT_LIB_PRAGMAS=0"}
	
	configuration "windows"
		defines "WIN32"
		
	configuration {"gmake", "linux or bsd"}
        defines {"HAVE_CONFIG_H", }
        includedirs {"."}
		
	configuration "Debug"
		targetsuffix "D"
		defines "_DEBUG"
		flags "Symbols"

	configuration "Release"
		defines "NDEBUG"
		flags {"OptimizeSpeed", "NoFramePointer", "ExtraWarnings", "NoEditAndContinue"};

[QUOTE=Alfonse Reinheart;1251153]Try replacing the FreeGLUT.lua file in the freeglut directory with this one.

if(_ACTION == "gmake") then
	if(os.get() == "linux" or os.get() == "bsd") then
		os.execute("sh ./configure");
	end
end

project "freeglut"
	kind "StaticLib"
	language "c"
	includedirs {"include"}
	targetdir "lib"
	files {"src/*.c"};
	
	defines {"FREEGLUT_STATIC", "_LIB", "FREEGLUT_LIB_PRAGMAS=0"}
	
	configuration "windows"
		defines "WIN32"
		
	configuration {"gmake", "linux or bsd"}
        defines {"HAVE_CONFIG_H", }
        includedirs {"."}
		
	configuration "Debug"
		targetsuffix "D"
		defines "_DEBUG"
		flags "Symbols"

	configuration "Release"
		defines "NDEBUG"
		flags {"OptimizeSpeed", "NoFramePointer", "ExtraWarnings", "NoEditAndContinue"};

[/QUOTE]

The change then yields this error:

freeglut_callbacks.c
In file included from src/freeglut_callbacks.c:29:0:
src/freeglut_internal.h:32:24: fatal error: config.h: No such file or directory
compilation terminated.
Makefile:152: recipe for target 'obj/Release/freeglut_callbacks.o' failed
mingw32-make: *** [obj/Release/freeglut_callbacks.o] Error 1

Did you redo the Premake4 step after copying that over your freeglut.lua file?

Sorry dumb mistake on my part. Thank you very much, that helped a ton. If you don’t mind me asking one more thing though, why didn’t it build before? I’m thinking from looking over the two lua files that it has something to do with gmake not having been configured to build on windows from that file?

I had lots of trouble trying to make FreeGLUT work on OS X. It seems that X11.org doesn’t support OpenGL 3.2 contexts on OS X and you need that in order to use FreeGLUT with these tutorials.

Because of that I’m redoing the tutorials using FLGW3. I only adds parts from McKesson’s framework as needed, so the simpler tutorials are easier to compiler and understand. I’m only providing an Xcode project (works straight away on OS X), but the code should be pretty much cross-platform and a Makefile should not be difficult to write.

In case anybody is interested, you can find it here: https://github.com/rsanchezsaez/gltut-glfw

Hope it helps.

Was it really necessary for you to post the same thing on four separate threads? That’s basically spamming at this point. If you want to advertise your project, file a new item on it.

What’s more interesting is that you misspelled GLFW. And it’s obvious you just copy-and-pasted your text, since you misspelled it the same way in two other threads.

sapmming sukcs!! oh, wait …

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.