# OpenGL SDL/Opengl/MSVC6 compile problems...

## Recommended Posts

Something as simple as this shouldn't be causing me a problem, but I'm just about out of ideas here. Maybe someone here can point out a stupid mistake I'm not seeing. I'm trying to compile an open source project called Crown and Cutlass. http://sourceforge.net/projects/crownandcutlass/ I'm using MSVC6, and I've followed the quite simple SDL install instructions. I'm getting errors like this when I compile: c:\projects\crown\extensions.h(28) : error C2146: syntax error : missing ';' before identifier 'glMultiTexCoord2f' c:\projects\crown\extensions.h(28) : fatal error C1004: unexpected end of file found This long thing in caps is what's confusing the compiler obviously: PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2f = 0; For some reason, these typedefs aren't being loaded, even though I believe I've followed the SDL and project's install instructions correctly. If I comment that line out, the next GL typedef causes the same error. I've even tried literally copying the typedef line needed from glext.h, ex. (Which is really an unacceptable answer anyway, but fine for troubleshooting purposes.) typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); If I do this for every line I have a problem with, I still get linker errors. (Even though I am linking to everything I'm supposed to: opengl32.lib glu32.lib SDLmain.lib SDL.lib SDL_image.lib.) I have added NO_SDL_GLEXT (which I don't quite get the point of since we're including glext.h anyway) as a preprocessor definition of course--still doesn't help. I'm not new to programming, but I could be called an OpenGL extensions noob--what the heck am I missing here? I've been doing this stuff for years but this one has me stumped at the moment! (Nothing like troubleshooting preprocessor "logic"! :p ) Anyone have any ideas? I'll paste the entire "problem" header below.
/* David Thulson
* Crown and Cutlass
*/

#if !defined ( _EXTENSIONS_H_ )
#define _EXTENSIONS_H_

#if defined (WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

#include "SDL_opengl.h"

#ifndef WIN32
#define GL_GLEXT_PROTOTYPES
#endif
#include <GL/glext.h>

#if defined (WIN32)

// Multitexturing functions
// Note: these are actually declared in extensions.cpp
extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2f;
extern PFNGLACTIVETEXTUREARBPROC glActiveTexture;
extern PFNGLACTIVETEXTUREARBPROC glClientActiveTexture;

// For VAs and VBOs
extern PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements;

// VBO Extension Function Pointers
extern PFNGLGENBUFFERSARBPROC glGenBuffers;
extern PFNGLBINDBUFFERARBPROC glBindBuffer;
extern PFNGLBUFFERDATAARBPROC glBufferData;
extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffers;

#endif

void initExtensions();

bool checkExtension(const char *str);

#endif



##### Share on other sites
This is David Thulson, the project admin for Crown and Cutlass. Collin, the developer who works in MSVC6, responded in the thread on our project forums. Not that that means no one should answer here, just thought I should make a note of it.

FYI, the NO_SDL_GLEXT macro tells SDL not to include it's own version of the extensions header, so while we don't check for it in our code, it's still useful. Here's a quote from the comment that starts on line 51 of SDL_opengl.h:
/* This file taken from "GLext.h" from the Jeff Molofee OpenGL tutorials.   It is included here because glext.h is not available on some systems.   If you don't want this version included, simply define "NO_SDL_GLEXT" */

I tried using SDL's extension stuff for a bit, but it only gave me trouble. It would probably have worked eventually, but we just decided to stick with what we had. Anyway, that's what that define does. Try Collin's advice and keep us posted. Even if your problem gets solved here, could you post your final status/solution in the sourceforge project thread? That way we get the solution as well as the problem in our forum, so if other people have the same trouble they can find the answer easier. Thanks.

##### Share on other sites
Thanks man, turns out that an outdated header WAS the problem, although not one of the headers we were thinking about.

An outdated glu.h was the problem it appears, which based on what it says it does makes perfect sense.

That's the good news... the bad news is, I happened to find the "updated" file on my system and not on some website, so I have NO idea where anyone else would find it if they have the same issues...

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627700
• Total Posts
2978695
• ### Similar Content

• A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

-What I'm using:
C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.
-Questions
Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.
• By dud3
How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below?
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

References:
Code: https://pastebin.com/Hcshj3FQ
The video shows the difference between blender and my rotation:

• 21
• 14
• 12
• 10
• 12