issue building unofficial opengl sdk

I’m trying to build the unofficial opengl sdk (glsdk.sourceforge.net), and I’m running into this issue. I’m not sure if I’m missing some dependency but I’ve no idea what config.h is. I just unzipped the glsdk to the directory and ran these commands:

C:\MinGW\include\glsdk_0.4.0>premake4 gmake
‘sh’ is not recognized as an internal or external command,
operable program or batch file.
Building configurations…
Running action ‘gmake’…
Generating Makefile…
Generating glload/Makefile…
Generating glimg/Makefile…
Generating glfw/Makefile…
Generating freeglut/Makefile…
Generating glutil/Makefile…
Generating glmesh/Makefile…
Done.

C:\MinGW\include\glsdk_0.4.0>mingw32-make config=debug
“==== Building glload (debug) ====”
Creating lib
Creating Debug
gll_c.c
gll_gl_ext.c
gll_cpp.cpp
wgll_ext.c
Linking glload
“==== Building glimg (debug) ====”
Creating lib
Creating Debug
DdsLoader.cpp
ImageCreator.cpp
ImageFormat.cpp
ImageSet.cpp
ImageSetImpl.cpp
StbLoader.cpp
TestLoader.cpp
TextureGenerator.cpp
Util.cpp
stb_image.c
Linking glimg
“==== Building glfw (debug) ====”
Creating library
Creating obj/Debug
enable.c
fullscreen.c
glext.c
image.c
init.c
input.c
joystick.c
stream.c
lib/stream.c:31:0: warning: “_CRT_SECURE_NO_WARNINGS” redefined [enabled by defa
ult]
<command-line>:0:0: note: this is the location of the previous definition
tga.c
thread.c
time.c
window.c
win32_dllmain.c
win32_enable.c
win32_fullscreen.c
win32_glext.c
win32_init.c
win32_joystick.c
win32_thread.c
win32_time.c
win32_window.c
Linking glfw
“==== Building freeglut (debug) ====”
Creating lib
Creating obj/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.
mingw32-make[1]: *** [obj/Debug/freeglut_callbacks.o] Error 1
mingw32-make: *** [freeglut] Error 2

C:\MinGW\include\glsdk_0.4.0>

I just realized the premake did not succeed since it used the ‘sh’ command while I’m on windows. Should I have used a flag besides gmake?

The Premake4 gmake build is designed for the standard GNU tools. So you should be using it only on Linux or other systems where those tools have been installed.

If you’re using Windows, I would suggest using Code::Blocks or Visual Studio.

PLEASE DISREGARD – I didn’t notice your tutorials come with glsdk and I’m to simply build them in place, not get glsdk myself. I’ll keep the rest of the post here in case it’s ever useful to some googler somewhere. (I’m still not sure why it couldn’t load glloadD.lib when I had manually put my own copy of glsdk in the classpath and built it though)

I’m actually trying to build your tutorial projects. I’ve switched to vs2010 as suggested and get this error (after running ‘premake4 vs2010’ and then attempting to build in vs2010):

Unable to start program
‘…\framework\lib\framework.lib’.
The specified file is an unrecognized or unsupported binary format.

Not sure what to make of this. Any advice?

Edit: I thought perhaps there were some left over files from when I ran ‘premake4 gmake’ & ‘mingw32-make’, so I used a fresh directory and got this error:

1>------ Build started: Project: framework, Configuration: Debug Win32 ------
1> Timer.cpp
1> Scene.cpp
1> Mesh.cpp
1> framework.cpp
1> Generating Code…
1> framework.vcxproj -> C:\Projects\Tutorial 0.3.8\framework\lib\frameworkD.lib
2>------ Build started: Project: Tut 01 Main, Configuration: Debug Win32 ------
2> tut1.cpp
2>LINK : fatal error LNK1104: cannot open file ‘glloadD.lib’
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have glsdk in my class path so I’m not entirely sure why vs2010 can’t find glloadD.lib – do I have to add each sub-directory to the classpath? I’m not entirely sure which gui option lets me add glsdk as a dependency.

Classpath? This is C++, not Java.

In any case, the error suggests that you didn’t build the SDK. The tutorials come with it, but you still have to build it. That’s why the instructions tell you to build it :wink:

Yes I had built the glsdk that I had manually unpacked, but I didn’t know how to change vs2010’s include path (I guessed windows classpath).

Once I saw the glsdk included with your tutorial I built it, and I presume your premake script handled the rest.

Thanks for the timely replies though, look forward to reading your tutorial.

I’m getting the same error:

Unable to start program
‘…\framework\lib\frameworkD.lib’.
The specified file is an unrecognized or unsupported binary format.

and I don’t quite understand what you did to fix it. I generated the VisualStudio2010 files by calling:

premake4 vs2010 file=premake4.lua

in the root directory and then tried to build/run that project in VS2010. What am I missing?

Thanks!

You have to select one of the actual tutorial projects, right-click on it, and select “Set as Startup Program”. Then you can run it from the debugger.

Thank you for your help!

I did that for Tut01 and I got the error:

error LNK1104: cannot open file ‘glloadD.lib’

any ideas?

That’s a linker error; it failed to compile.

Did you successfully build the SDK? In Debug as well as Release?

[QUOTE=Alfonse Reinheart;1244580]That’s a linker error; it failed to compile.

Did you successfully build the SDK? In Debug as well as Release?[/QUOTE]

No you’re right, the build fails. How can I like the file correctly?

Did you successfully build the SDK included with the download? In Debug as well as Release?

I generated the VS2010 files as given above, with and then I tried to build it from VS2010 and it failed. Is that what you mean?

Ohh I see what you meant! I hadn’t built it properly. It’s working now, thank you for your help!

Could you kindly explain how did you resolve your problem? What do you mean with “I hadn’t build it properly” ?
Thank you

[QUOTE=Yariokone;1246455]Could you kindly explain how did you resolve your problem? What do you mean with “I hadn’t build it properly” ?
Thank you[/QUOTE]

In retrospec, he hadn’t build the .sln’s granted by premake4.
ex.

  • premake4 vs2008 [x32|x64]
    where [x32|x64] is optional.

After this procedure you should have glsdk.sln.
With glsdk.sln, build it in VS or your preferable enviroment.
After building these executables you should be able to build a tutorial.

Sorry for the late response. I happened to skim across this thread late.

Got the same problem, solved! Thanks Mr. Alfonse!

I’m using your tutorials as resource tools for teaching my lecture in Interactive Computer Graphics. Had to start the entire course from a blank slate around second half of last year and you’ve been of great help! :smiley:

P.S.: It might help if the sentence “Using the generated build files, compile for both debug and release.” in your tutorial emphasize a bit on building the glsdk solution. I believe this is what is confusing the newbies who are assuming the Tutorial projects are the only VS projects to be run.

Many thanks!

I was wondering, is there a way I can contact the said tutorial directly for a short discussion? The account here on the discussion board seems to have private messaging disabled.