tutorial building for "Learning Modern 3D Graphics

I’m just trying to tell you how other people see things

No, you’re telling me how you see things. Then you extrapolate from this, proposing that your view is universal and I’m wrong if I don’t follow along.

That doesn’t mean you aren’t right. But it also doesn’t mean that you are right. It is simply your perspective.

That’s a rather emotional, theoretical, ideological objection.

Yes it is. I have no problems making decisions based on emotional, theoretical, and ideological bases.

And again, we’re not talking about some onerous burden here. It’s one command line. So I don’t see how it’s such a big deal.

Thanks at least for licensing your code sanely; none of the other extension wrapper projects do.

GLEW: uses what is effectively the BSD license, though they don’t exactly call it that.

GLee (effectively defunct): uses the modified BSD license. Equivalent to MIT.

GL3w: Public domain.

GLxx: BSD license (though GPL for the actual build scripts).

So what extension wrapper projects are you talking about? The Klay Game Engine’s GLloader library (I have no idea what license it uses; I saw a 100MB zipped download and decided against it)?

Codegen in both of these is GPL. I guess you never drilled down that far?

BTW Glee shows updates to Sourceforge as recent as September 2011. Commit comments claim to support OGL 4.2. The webpages that turn up when you Google for GLee, however, are quite stale.

GL3w: Public domain.

I forgot about that one. Too many of these things.

GLxx: BSD license (though GPL for the actual build scripts).

Like I said.

The Klay Game Engine’s GLloader library (I have no idea what license it uses;

GPL.

Hi, I’m trying to build the first tutorial using vs2010. I’ve done all the stuff from Building the Tutorials but when I try and run it in vs2010 I get a Unable to start frameworkD.lib message. The specified file is an unrecognized or unsupported binary format. Tried running the .exe and it flashes a cmd window at me which I think says Unable to generate context.

hi guys, im am also a newbie in opengl, i came across this tutorial a couple of days before and i am truying to build the unofficial opengl sdk and then after that the tutorials arcsynthesis. I decided to learn form this tutorial cause it is well build and it uses the best, like glm or the like… so new the big question: i also have problems buiding the unofficial opengl sdk and i also get the error message:

Unable to start program
‘C:\arcsynthesis\Tutorial\glsdk\glload\lib\glloadD.lib’
The specified file is an unrecognized or unsupported binary format

i am using a macbook pro, and i am running windows7 64-bit, Visual Studio 2010.

what i actually do is:

  1. download the source distribution, unzip
  2. navigate to the glsdk form command prompt
  3. run the command: premake4 vs2010 (i also tried premake4 --platform=x64 vs2010). After this step premake generates the glsdk visual studio 2010 project
  4. open the project with the visual basic 2010 and then start the debugging

after this step i get an error message dialog with the message i wrote above

and the output of visual studio shows this message

1>------ Build started: Project: glload, Configuration: Debug Win32 ------
1> wgll_ext.c
1> gll_gl_ext.c
1> gll_c.c
1> Generating Code…
1> gll_cpp.cpp
1> glload.vcxproj -> C:\arcsynthesis\Tutorial\glsdk\glload\lib\glloadD.lib
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

after this i repeat the same steps with the tutorials:

  1. navigate to the Tutorial form command prompt
  2. run the command: premake4 vs2010 (i also tried premake4 --platform=x64 vs2010). After this step premake generates the AllTutorials visual studio 2010 project
  3. open the project with the visual basic 2010 and then start the debugging

after this step i get again an error message like the one above:

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

so i hoppe someone can give a hint and tell me what to do… thanks in advance

open the project with the visual basic 2010 and then start the debugging

The SDK is a library; you can’t execute a library. You compile it.

open the project with the visual basic 2010 and then start the debugging

Start debugging what? There are 45 separate executables in that project. Did you tell the IDE which specific project you wanted to debug? Because it defaults to the Framework library, which again is a library and cannot be debugged.

If you want to execute a particular project, you have to right-click on it and make it the active project.

As it is, this tutorial is way too difficult to get to build.

In a tutorial like this - and any project really - building should work out of the box with a single step. In Visual studio this would mean a solution with proper dependencies to projects and build steps. CMake could do it - I am not impressed by this premake thing.

Way too difficult? It’s two steps. First you build the SDK. Then you build the tutorial of interest.

And that’s not even his problem. His problem is attempting to execute a library. So your suggestion wouldn’t even help.

CMake could do it - I am not impressed by this premake thing.

I could set Premake up to include the SDK as part of each tutorial’s build. I didn’t because that’s really stupid. Libraries exist for a reason.

[QUOTE=tksuoran;1243571]As it is, this tutorial is way too difficult to get to build.

In a tutorial like this - and any project really - building should work out of the box with a single step. In Visual studio this would mean a solution with proper dependencies to projects and build steps. CMake could do it - I am not impressed by this premake thing.[/QUOTE]

I don’t agree. It’s more elegant and future proof to create these premake scripts and get ready for dozens of DEV tools. If you add VS solutions and projects, then for what version of VS? What if the user has an older version of VS? Using premake4 is not too dificult. Imho using premake is much more simple then using makefiles and CMake.

Having only written some Java or C# code within a pleasant IDE might not provide enough background for the tutorial (I don’t know, I haven’t finished the tutorial yet). But in case somebody wonders what to do with the solution files premaker outputs, here is, what works in my case for Visual Studio 2010 (being a IDE-spoiled beginner myself):

  • do every step as in the tutorial. When you have gotten the .sln files from premaker: open the .sln belonging to the glsdk in Visual Studio, click “built->configuration-manager” chose “debug”, built the project. Click “built-> configuration-manager” chose “release”, built the project.
  • do the same thing (“premaker”, Visual Studio: build “debug” and “release”) for all tutorials.
    I believe this is essentially what is written in the “Building the tutorials”, just applied to VS2010.
    You will find different places in the VS2010 where words like “release” and “debug” appear. I found this entry helpful:
    VS2010: Three concurrent ways to set build or debug compiling, what to choose?

By the way, it seems to be the right place to say “Thank You!” to Mr. McKesson for undertaking the work of writing the book an putting it online.

[QUOTE=Alfonse Reinheart;1243572]Way too difficult? It’s two steps. First you build the SDK. Then you build the tutorial of interest.

And that’s not even his problem. His problem is attempting to execute a library. So your suggestion wouldn’t even help.[/QUOTE]

I was not replying to his post, I was replying to the whole thread.

I agree that libraries exist for a reason. However, I consider that an orthogonal to the build system. If you include libraries as source in your distribution package, I see no reason why the build system can not simply do the right thing. When libraries are used, I would expect the meta build tool (cmake, premake, configure script etc.) to locate the libraries and configure executable builds so that they work - or - report an error locating / configuring dependencies. Isn’t this the whole point in meta build tools?

The tutorial is very nice, that is the reason why I hope it would build without a hassle.

I was perhaps a bit too brief. I did mention cmake, and the idea is that you can make cmake to produce VS solution with proper project dependencies. You make all executable projects depend on the libraries they need. You can even do this with both libraries which you include as part of your source, and also with external libraries which are located during cmake configuration step. I see no reason why a build should end in an error due to missing dependency. Such errors should be reported by the meta build tool, which should also do some effort to locate the libraries during configure step.

[QUOTE=TheFritz;1243774]- do every step as in the tutorial. When you have gotten the .sln files from premaker: open the .sln belonging to the glsdk in Visual Studio, click “built->configuration-manager” chose “debug”, built the project. Click “built-> configuration-manager” chose “release”, built the project.

  • do the same thing (“premaker”, Visual Studio: build “debug” and “release”) for all tutorials.
    I believe this is essentially what is written in the “Building the tutorials”, just applied to VS2010.[/QUOTE]

Thanks TheFritz, this solved my problem with building the tutorials in Visual Studio . Another thing to keep in mind, make sure you set your startup project (right-click project in Solution Explorer and click Set as Startup Project)to the tutorial you are trying to view. Otherwise you will get the misleading “Unable to start program (…)/frameworkD.lib”

Hey!
I also had trouble with building the tutorials. When I figured out how to do it, I wrote a little guide to help people who are struggling with the build process. It’s written primarily for Windows 7 and Visual Studio 2010, but most of the concepts apply on all platforms! Here’s the URL: emillindfors.fi/blog/building-gltut

Hope this helps someone!

Hello!
I’m new to the forum and to OpenGL too…that’s why I’m trying to get these tutorials work.

Anyway it seems i didn’t catch something or doing wrong cause when I build the files using “premake4 xcode3” in glsdk for example I get these lines:

Building configurations…
Running action ‘xcode3’…
Generating glload/glload.xcodeproj/project.pbxproj…
Generating glimg/glimg.xcodeproj/project.pbxproj…
Generating freeglut/freeglut.xcodeproj/project.pbxproj…
Generating glutil/glutil.xcodeproj/project.pbxproj…
Generating glmesh/glmesh.xcodeproj/project.pbxproj…
Done.

but after that I can’t move onward:
I understood I have to compile it…the problem is I don’t get any file in the folder to compile, just .xcodeproj files in every subfolder, and if I try to compile them one by one some of them work and some else give errors…

PS: Trying to perform actions like “premake4 vs2008” or “premake4 gmake” works different…creating a .sln file or a MAKEFILE respectively… (In the main folder!)

Hope I’ve been clear
Waiting for an help.

Waiting for an help.

There’s not much I can do to help here. MacOSX is not supported by my code, for several reasons. First, I don’t have ready access to MacOSX, so I can’t actually test anything there. Also, I don’t know anything about XCode or Premake’s support for XCode. Second, my code uses OpenGL 3.3, and MacOSX only support 3.2 (for some reason). So it wouldn’t run anyway.

I’m sorry, but there’s nothing I can do.

[QUOTE=Alfonse Reinheart;1248769]
I’m sorry, but there’s nothing I can do.[/QUOTE]

:frowning: Hoped there was a solution for this…anyway thank you for your answer ;)…guess i’ll have to switch to my win partition or follow the tutorials on my desktop during weekends when I’m back home then!

I think I’m having the same basic problem that many others are having when trying to build the tutorials in CodeBlocks on Windows 7.
Here’s some background:
I followed the instructions to download and build the OpenGL SDK, and Premake4.
I used Premake4 with premake4 codeblocks command in the SDK folder and it created a CodeBlocks file for me.
I opened this file in CodeBlocks (v12.11) and started a build.
I also downloaded the Tutorials and used Premake4 in that folder to make a codeblocks file.
I opened the tutorial file in CodeBlocks and tried to build.

I get a compile error for the ld.exe file that says “cannot find -lglloadD”

I read through this thread, but I cannot get this issue solved. Can someone please help me to diagnose and resolve this error.
I still new to C++ so these kinds of errors knock me out.

Thanks.

[QUOTE=Alfonse Reinheart;1248769]There’s not much I can do to help here. MacOSX is not supported by my code, for several reasons. First, I don’t have ready access to MacOSX, so I can’t actually test anything there. Also, I don’t know anything about XCode or Premake’s support for XCode. Second, my code uses OpenGL 3.3, and MacOSX only support 3.2 (for some reason). So it wouldn’t run anyway.

I’m sorry, but there’s nothing I can do.[/QUOTE]
Finally I have free time to spend at home and can use my desktop!
Tonight i tried to build the tutorials so I could start your book, anyway I have encountered a problem while trying to build the tutorials under VS2010:

Building the glskd all went well, but when i try to build the tutorials, i.e. as an unique project (but one by one is the same) the framework would build, but none of the Tut builds getting this error [ LINK : fatal error LNK1123: errore durante la conversione in COFF: file non valido o danneggiato ] (in english LINK : fatal error LNK1123: error during COFF conversion: file not valid or damaged )

Hope you can help solving this, thank you!

[EDIT] Seem to have solved!, thank you anyway!

Hello,

I 'm building the tutorials on ubuntu 12.10. Premake runs fine. Then I run make: it builds tutorials 1 and 13 and then spits the following error:

==== Building Tut 12 Scene Lighting (debug) ====
Lights.cpp
In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h: In instantiation of ‘void Framework::ConstVelLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<glm::detail::tvec3<float> >; ValueType = glm::detail::tvec3<float>]’:
Lights.cpp:66:35:   required from here
../framework/Interpolators.h:183:5: error: ‘distance’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:38:7: note: ‘float distance(const vec3&, const vec3&)’ declared here, later in the translation unit
In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<glm::detail::tvec4<float>, float> >; ValueType = glm::detail::tvec4<float>]’:
Lights.cpp:149:41:   required from here
../framework/Interpolators.h:76:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:133:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h:77:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:134:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h: In instantiation of ‘void Framework::TimedLinearInterpolator<ValueType>::SetValues(const BidirectionalRange&, bool) [with BidirectionalRange = std::vector<std::pair<float, float> >; ValueType = float]’:
Lights.cpp:155:58:   required from here
../framework/Interpolators.h:76:5: error: ‘GetValue’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:133:7: note: ‘float GetValue(const MaxIntensityData&)’ declared here, later in the translation unit
In file included from Lights.h:12:0,
                 from Lights.cpp:13:
../framework/Interpolators.h:77:5: error: ‘GetTime’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
Lights.cpp:134:7: note: ‘float GetTime(const MaxIntensityData&)’ declared here, later in the translation unit
make[1]: *** [obj/Debug/Tut 12 Scene Lighting/Lights.o] Error 1
make: *** [Tut 12 Scene Lighting] Error 2

One more question. Why the C headers? Surely you realise that these tutorials are visited by many who asprite to learn c++ and opengl all at once. The mixture of languages is pretty confusing.

spits the following error

You should probably submit a full bug report on that, rather than just making a post here.

Surely you realise that these tutorials are visited by many who asprite to learn c++ and opengl all at once.

If you try to learn C++ and OpenGL “all at once”, you won’t learn either one very well. That’s why I told people up front not to do that. And I quote: “You are expected to be able to read C and reasonable C++ code. If “Hello, world!” is the extent of your C/C++ knowledge, then perhaps you should write some more substantial code before proceeding with trying to render images. 3D graphics rendering is simply not a beginner programming task; this is just as true for traditional graphics learning as for modern graphics learning.”

The mixture of languages is pretty confusing.

The mixture of languages is pretty standard. C++ contains much of C and is language-compatible with it. OpenGL is usually defined in terms of C, so that’s how it gets used.