Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: Issue Compiling Jason L. McKesson's OpenGl Tutorial

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    7

    Question 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.

    Code :
    premake4 gmake

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

    Code :
    make config=debug

    Code :
    "==== 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

    Code :
    make config=release

    Code :
    "==== 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.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Try replacing the FreeGLUT.lua file in the `freeglut` directory with this one.

    Code :
    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"};

  3. #3
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    7
    Quote Originally Posted by Alfonse Reinheart View Post
    Try replacing the FreeGLUT.lua file in the `freeglut` directory with this one.

    Code :
    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"};
    The change then yields this error:

    Code :
    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

  4. #4
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Did you redo the Premake4 step after copying that over your freeglut.lua file?

  5. #5
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    7
    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?

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    4
    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.
    Last edited by rsanchezsaez; 09-01-2013 at 07:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •