PDA

View Full Version : Extension problems



Lurking
08-07-2002, 10:43 PM
im making a very small class to handle extensions. i desided to try using the gl_init_extension() func from the nvidia sdk. But it generates hundreds of errors! Here's my code:
============CExtension.h====================
#include <windows.h>

#include <gl/gl.h>
#include <gl/glext.h>

#define GLH_EXT_SINGLE_FILE
#define GLH_NVEB_USING_NVPARSE

#include <glh_nveb.h>
#include <glh_extensions.h>
#include <glh_obs.h>

//#include <nvparse.h>

#include <stdio.h>
#include <stdlib.h>
using namespace glh;


class CExtension{
public:
//int MultiTexNum;
bool LoadExt(char *ext);

CExtension() { };
~CExtension() { };
};
============CExtension.cpp==================
#include "CExtension.h"

bool CExtension::LoadExt(char *ext){
bool isLoaded;
if(!glh_init_extensions(ext))
isLoaded = false;
else
isLoaded = true;
return isLoaded;
}
=================Errors=====================
Couple hundred of these
CRenderer.obj : error LNK2005: _glMapParameterfvNV already defined in CExtension.obj
CRenderer.obj : error LNK2005: _glMapParameterivNV already defined in CExtension.obj
CRenderer.obj : error LNK2005: _glMapControlPointsNV already defined in CExtension.obj
CRenderer.obj : error LNK2005: _glVertexWeightPointerEXT already defined in CExtension.obj
CRenderer.obj : error LNK2005: _glVertexWeightfvEXT already defined in CExtension.obj
CRenderer.obj : error LNK2005: _glVertexWeightfEXT already defined in CExtension.obj

and a couple of these
CRenderer.obj : warning LNK4006: _wglGetPbufferDCARB already defined in CExtension.obj; second definition ignored
CRenderer.obj : warning LNK4006: _wglCreatePbufferARB already defined in CExtension.obj; second definition ignored
CRenderer.obj : warning LNK4006: _glAddSwapHintRectWIN already defined in CExtension.obj; second definition ignored
CRenderer.obj : warning LNK4006: _glCopyTexSubImage3D already defined in CExtension.obj; second definition ignored
CRenderer.obj : warning LNK4006: _glTexSubImage3D already defined in CExtension.obj; second definition ignored
CRenderer.obj : warning LNK4006: _glTexImage3D already defined in CExtension.obj; second definition ignored

- Lurking

Morglum
08-07-2002, 11:25 PM
add the 2 following lines at the beginning of CExtension.h :

#ifndef __CEXTENSION_H__
#define __CEXTENSION_H__

and at the end of this file :

#endif //__CEXTENSION_H__

do the same for every homemade header, of course replacing __CEXTENSION_H__
by __FILENAME_H__, where FILENAME is your header's filename.