Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: A problem trying to set up some tutorials

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2017

    A problem trying to set up some tutorials

    I'm going to learn OpenGL with the book "Learning Modern 3D Graphics Programming Jason L. McKesson", but I have some problems trying to build their tutorials.
    The source file of he tutorials is here: (also the book named TutorialsComp.pdf)

    These are the instructions to build the tutorials:

    Building the Tutorials

    These tutorials require a number of external libraries in order to function. The specific version of these libraries that the tutorials use are distributed
    with the tutorials. The tutorial source distribution [] can be found online. This section will describe
    each of the external libraries, how to build them, and how to build the tutorials themselves. Windows and Linux builds are supported.
    You will need minimal familiarity with using the command line in order to build these tutorials. Also, any mention of directories is always relative
    to where you unzipped this distribution.

    File Structure

    The layout of the files in the tutorial directory is quite simple. The framework directory and all directories of the form Tut* contain all of the
    source code for the tutorials themselves. Each Tut* directory has the code for the various tutorials. The framework directory simply contains
    utility code that is commonly used by each tutorial.
    Each tutorial contains one or more projects; each project is referenced in the text for that tutorial.
    The Documents directory contains the source for the text documentation explaining how these tutorials work. This source is in xml files using
    the DocBook 5.0 format.
    Every other directory contains the code and build files for a library that the tutorials require.

    Necessary Utilities

    In order to build everything, you will need to download the Premake 4 [] utility for your platform of choice.
    Premake is a utility like CMake []: it generates build files for a specific platform. Unlike CMake, Premake is strictly a
    command-line utility. Premake's build scripts are written in the Lua language [], unlike CMake's build scripts that
    use their own language.
    Note that Premake only generates build files; once the build files are created, you can use them as normal. It can generate project files for Visual
    Studio, Code::Blocks [], and XCode, as well as GNU Makefiles. And unless you want to modify one of the tutorials,
    you only need to run Premake once for each tutorial.
    The Premake download comes as a pre-built executable for all platforms of interest, including Linux.

    Unofficial OpenGL SDK

    The Unofficial OpenGL SDK [] is an aggregation of libraries, unifying a number of tools for
    developing OpenGL applications, all bound together with a unified build system. A modified SDK distribution is bundled with these tutorials;
    this distro does not contain the documentation or GLFW that comes with the regular SDK.
    The SDK his library uses Premake to generate its build files. So, with premake4.exe in your path, go to the glsdk directory. Type premake4
    plat, where plat is the name of the platform of choice. For Visual Studio 2008, this would be “vs2008”; for VS2010, this would be “vs2010.”
    This will generate Visual Studio projects and solution files for that particular version.
    For GNU and makefile-based builds, this is “gmake”. This will generate a makefile. To build for debug, use make config=debug; similarly,
    to build for release, use make config=release.
    Using the generated build files, compile for both debug and release. You should build the entire solution; the tutorials use all of the libraries
    Note that there is no execution of make install or similar constructs. The SDK is designed to be used where it is; it does not install itself
    to any system directories on your machine. Incidentally, neither do these tutorials.

    Tutorial Building

    Each tutorial directory has a premake4.lua file; this file is used by Premake to generate the build files for that tutorial. Therefore, to build
    any tutorial, you need only go to that directory and type premake4 plat, then use those build files to build the tutorial.
    Each tutorial will generally have more than one source file and generate multiple executables. Each executable represents a different section of
    the tutorial, as explained in that tutorial's documentation.
    If you want to build all of the tutorials at once, go to the root directory of the distribution and use Premake on the premake4.lua file in that
    directory. It will put all of the tutorials into one giant project that you can build.
    If you look at any of the tutorial source files, you will not find the main function defined anywhere. This function is defined in framework/
    framework.cpp; it and all of the other source files in the framework directory is shared by every tutorial. It does the basic boilerplate work:
    creating a FreeGLUT window, etc. This allows the tutorial source files to focus on the useful OpenGL-specific code.

    I'm going to use CodeBlocks. These are the steps that I follow:

    - I downloaded "Tutorial 0.3.8 and Premake4.exe"
    - I unzip all Tutorial 0.3.8 stuff in a folder.
    - I put Premake4.exe in \Tutorial 0.3.8\glsdk folder and I opened a command prompt in the folder and I typed: premake4 codeblocks.
    glsdk.workspace was created.
    - I put Premake4.exe in \Tutorial 0.3.8\Test folder and I opened a command prompt in the folder and I typed: premake4 codeblocks.
    Test.workspace was created.
    - I opened Test.workspace with Codeblocks I hit "Build and Run"

    I see the folloing errors:

    Click image for larger version. 

Name:	error.jpg 
Views:	13 
Size:	21.1 KB 
ID:	2619

    This is some weird for me, the proyect need the following libs:

    Click image for larger version. 

Name:	2.jpg 
Views:	12 
Size:	13.5 KB 
ID:	2620

    It searchs for them in the following directories:

    Click image for larger version. 

Name:	7.png 
Views:	15 
Size:	6.3 KB 
ID:	2624

    But when I search if these libs exists, I find that:

    For example \glsdk\freeglut\lib exists: (and codeblocks not display an error finding this)

    Click image for larger version. 

Name:	4.jpg 
Views:	12 
Size:	20.8 KB 
ID:	2622

    But \glsdk\glimg\lib doesn't exists:

    Click image for larger version. 

Name:	5.jpg 
Views:	15 
Size:	19.1 KB 
ID:	2623

    What am I doing wrong or what am I missing?

    I also tried to build at once all proyects in the main folder, but I get the same error.
    I fact, I don't understand what is the purpose of generate the glsdk.workspace file.

    Thanks for reading.
    Last edited by Zenith; 01-24-2018 at 07:42 AM.

  2. #2
    Newbie Newbie
    Join Date
    Jan 2018
    Did you add the includes directories in the compiler settings ?
    You also should look in the source directory if there is any .a files.

Posting Permissions

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