Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Extension problems

  1. #1
    Intern Contributor
    Join Date
    Sep 2001
    Location
    Lewisville, TX
    Posts
    97

    Extension problems

    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

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2001
    Posts
    409

    Re: Extension problems

    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.

Posting Permissions

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