Compiling OpenGL/SDL Examples in Windows 7

This is a discussion on Compiling OpenGL/SDL Examples in Windows 7 within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys, I'm a relatively experienced programmer, but relatively new to C and C++, currently studying basic computer graphics at ...

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    2

    Unhappy Compiling OpenGL/SDL Examples in Windows 7

    Hey guys,

    I'm a relatively experienced programmer, but relatively new to C and C++, currently studying basic computer graphics at university and looking for good examples using OpenGL 3 and SDL 1.3 on which to base my next project.

    Can anyone compile these OpenGL/SDL example programs in Windows 7?

    http://es.g0dsoft.com/OpenGLCodeSamp...mples_12_10.7z

    If so, could you please guide me through the process, step-by-step? I've spent a whole day trying to get these to compile, as they are in the bundled executables, with no success.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    611
    Seems the writer is using CMake to compile them. The path of least resistance would likely have you do the same. Compiling in an IDE would entail adding the files for each sample and the relevant files in the 'common' and 'external' directories to a corresponding workspace/project. Working out what constitutes relevant will be a pain though.

    An altogether easier route, if with more startup cost, would be to compile the cpp files in the common directory to a static library and the c/cpp files in each 'external' subdirectory to their own static library. Then you just reference all the static libs when building the other samples.

    Yes, it's a kerfuffle; no, with these samples there is no click and go option, these are all the choices you have.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    2
    I think the CMake files are incorrect. I've tried all of the above methods.

    I've tried using CMake to compile for MinGW-Make, Codeblocks with MinGW, and Visual Studio Express 2010.

    I've also tried organising the files manually in Codeblocks, Netbeans and Visual Studio Express 2010. Heck, I've even tried compiling in Linux to no avail!

    By organising the files manually, I've got close, but most of the problems seem to come from the AntTweakBar library - a library that generates very basic UI.

    The compiler keeps complaining that functions and objects like exit(), printf() and runtime_error were used in this library without being defined, too many times to go through and add the necessary includes manually. (cstdlib, cstdio, stdexcept)

    Any ideas? Perhaps a compiler option that includes these "standard" libraries for all sources?

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Don't feel like going through all the files to find all the possible places it complains about, but if it's mostly AntTweakBar, why not add the includes to AntTweakBar.h?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows 7, First Impressions
    By Mario F. in forum General Discussions
    Replies: 16
    Last Post: 08-11-2009, 06:46 AM
  2. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 08:27 PM
  3. Compiling Linux kernel on Windows
    By jmd15 in forum Linux Programming
    Replies: 9
    Last Post: 04-10-2006, 07:28 AM
  4. Compiling for Windows CE
    By LiX in forum Windows Programming
    Replies: 1
    Last Post: 12-06-2004, 07:53 AM
  5. Problem with Borland 5.5 Compiling Windows Programs
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 08-28-2001, 09:04 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21