lot of Linker Errors with "glext.h"
Hi i try to use the glext.h, for supporting multitexturing.
i include the header an define this in my program
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB=NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB=NULL;
when i compile i have linkererrors like this
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __extensionProcs
Debug/OpenGL.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
anyone know whats wrong ????
thanks wolf
You still have to declare the function variables inside of your program, for example in my program, in opengl.h I have
// Include this in any file you plan on using extensions
#include <GL/glext.h>
extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT;
extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT;
and then in opengl.cpp I declare the variables
PFNGLLOCKARRAYSEXTPROC glLockArraysEXT = NULL;
PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT = NULL;
and then later on I store the function addresses ( during my init code )
glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)wglGetProcAddress("glLockArraysEXT");
glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC) wglGetProcAddress ("glUnlockArraysEXT");
// Do some error checking here
Basically, all glext defines is the PFNGLUNLOCKARRAYSEXTPROC (in my example). At least thats all I''ve managed to get out of it. I''m not an expert on extensions by no means but hey, it works.
// Include this in any file you plan on using extensions
#include <GL/glext.h>
extern PFNGLLOCKARRAYSEXTPROC glLockArraysEXT;
extern PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT;
and then in opengl.cpp I declare the variables
PFNGLLOCKARRAYSEXTPROC glLockArraysEXT = NULL;
PFNGLUNLOCKARRAYSEXTPROC glUnlockArraysEXT = NULL;
and then later on I store the function addresses ( during my init code )
glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)wglGetProcAddress("glLockArraysEXT");
glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC) wglGetProcAddress ("glUnlockArraysEXT");
// Do some error checking here
Basically, all glext defines is the PFNGLUNLOCKARRAYSEXTPROC (in my example). At least thats all I''ve managed to get out of it. I''m not an expert on extensions by no means but hey, it works.
Oh God what a f.... is that with this extensions ?????
thanks for help but this dosent work
i need to put this in a class like this:
#include "glext.h"
class CTriangle
{
public:
CTriangle();
CTriangle(HGLRC hRC);
~CTriangle();
bool CreateTriangle(GLfloat x_pos, GLfloat y_pos, GLfloat z_pos,
GLfloat width, GLfloat height, GLfloat depth,
GLfloat red1, GLfloat green1, GLfloat blue1,
GLfloat red2, GLfloat green2, GLfloat blue2,
GLfloat red3, GLfloat green3, GLfloat blue3);
bool Rotate(GLfloat x, GLfloat y, GLfloat z, GLfloat degrees);
bool Translate(GLfloat x, GLfloat y, GLfloat z);
bool Scale(GLfloat x, GLfloat y, GLfloat z);
bool BindTexture(CTexture *Texture);
bool Render();
private:
HGLRC m_hRC;
GLfloat m_xpos;
GLfloat m_ypos;
GLfloat m_zpos;
GLfloat m_width;
GLfloat m_height;
GLfloat m_depth;
GLfloat m_red1, m_green1, m_blue1;
GLfloat m_red2, m_green2, m_blue2;
GLfloat m_red3, m_green3, m_blue3;
GLfloat m_xrot;
GLfloat m_yrot;
GLfloat m_zrot;
GLfloat m_degrees;
GLfloat m_scalex;
GLfloat m_scaley;
GLfloat m_scalez;
GLuint m_texture[2];
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
};
but my compiler dosen''t like my idea :-(
error C2629: ''void (__stdcall *)(unsigned int,float,float) ('' unerwartet
error C2238: Unerwartete(s) Token vor '';''
derror C2629: ''void (__stdcall *)(unsigned int) ('' unerwartet
error C2238: Unerwartete(s) Token vor '';''
ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
thanks for help but this dosent work
i need to put this in a class like this:
#include "glext.h"
class CTriangle
{
public:
CTriangle();
CTriangle(HGLRC hRC);
~CTriangle();
bool CreateTriangle(GLfloat x_pos, GLfloat y_pos, GLfloat z_pos,
GLfloat width, GLfloat height, GLfloat depth,
GLfloat red1, GLfloat green1, GLfloat blue1,
GLfloat red2, GLfloat green2, GLfloat blue2,
GLfloat red3, GLfloat green3, GLfloat blue3);
bool Rotate(GLfloat x, GLfloat y, GLfloat z, GLfloat degrees);
bool Translate(GLfloat x, GLfloat y, GLfloat z);
bool Scale(GLfloat x, GLfloat y, GLfloat z);
bool BindTexture(CTexture *Texture);
bool Render();
private:
HGLRC m_hRC;
GLfloat m_xpos;
GLfloat m_ypos;
GLfloat m_zpos;
GLfloat m_width;
GLfloat m_height;
GLfloat m_depth;
GLfloat m_red1, m_green1, m_blue1;
GLfloat m_red2, m_green2, m_blue2;
GLfloat m_red3, m_green3, m_blue3;
GLfloat m_xrot;
GLfloat m_yrot;
GLfloat m_zrot;
GLfloat m_degrees;
GLfloat m_scalex;
GLfloat m_scaley;
GLfloat m_scalez;
GLuint m_texture[2];
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB;
};
but my compiler dosen''t like my idea :-(
error C2629: ''void (__stdcall *)(unsigned int,float,float) ('' unerwartet
error C2238: Unerwartete(s) Token vor '';''
derror C2629: ''void (__stdcall *)(unsigned int) ('' unerwartet
error C2238: Unerwartete(s) Token vor '';''
ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Why would you want to make it a member of a class? Other functions that need to use it won't be able to.
Oh, and on a side note, it'd probably be a good idea to use arrays instead of 3 separate variables for colors, position, scale, ect. It would simplify the code a lot and make it easier to read.
[edited by - Hawkeye3 on December 18, 2002 5:35:55 PM]
Oh, and on a side note, it'd probably be a good idea to use arrays instead of 3 separate variables for colors, position, scale, ect. It would simplify the code a lot and make it easier to read.
[edited by - Hawkeye3 on December 18, 2002 5:35:55 PM]
quote:
Original post by wolf_2002
main.obj : error LNK2001: Nichtaufgeloestes externes Symbol __extensionProcs
Debug/OpenGL.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
anyone know whats wrong ????
thanks wolf
I''v said this often, but I say it again: Why don''t you get extension loading library?
Oh no, i can''t help myself, i put this code:
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB=NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB=NULL;
in the code from any tutorials (nehe) and it works.
but not in mine, i don''t no whats wrong.
''myopengl.h''
#include <windows.h> // Header File For Windows
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The GLaux Library
#include <gl\glprocs.h>
main.cpp
#include "myopengl.h"
#include "glext.h"
Stefu, with the extentions loading library don''t work too.
Thanks for helping.
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB=NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB=NULL;
in the code from any tutorials (nehe) and it works.
but not in mine, i don''t no whats wrong.
''myopengl.h''
#include <windows.h> // Header File For Windows
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The GLaux Library
#include <gl\glprocs.h>
main.cpp
#include "myopengl.h"
#include "glext.h"
Stefu, with the extentions loading library don''t work too.
Thanks for helping.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement