• Advertisement
Sign in to follow this  

more DLL woes (VS.Net 2003)

This topic is 4931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm trying to make an interface for my renderer, so i can switch between OGL and DX (thats the general idea) i'm using a static library to load the specific renderer class. the static lib contains an interface class that the .dll uses to abstract the graphics APIs. everything seems to work. i think that it has successfully linked to the static library because it doesn't complain about the #pragma; *sigh* except i get the following errors when i try to build : OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::BeginRendering(void)" (?BeginRendering@OGLRenderer@@UAEXXZ) OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::Render(void)" (?Render@OGLRenderer@@UAEXXZ) OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::EndRendering(void)" (?EndRendering@OGLRenderer@@UAEXXZ) heres the interface (if it helps) (simplified) :
// CInterface.lib
// CRenderer.h
/* a pure-virtual interface */
class CRenderer
{
    public:
      // defining these with {}
      // shut up 2 errors
      CRenderer() {}
      virtual ~CRenderer() {}
      
      // set up rendering states
      virtual void BeginRendering(void) = 0;
      // render everything to the back buffer
      virtual void Render(void) = 0;
      // clean up
      virtual void EndRendering(void) = 0;
};



the class in OGLRenderer.dll is :
#pragma comment(lib, "CInterface.lib")
#include "CRenderer.h"
class OGLRenderer : public CRenderer
{
    public:
      OGLRenderer();
      ~OGLRenderer();

      void BeginRendering(void);
      void Render(void);
      void EndRendering(void);
    private:
      /* insert private vars here */
};



the above functions in OGLRenderer.h are all defined in the .cpp file. (actually, i just made them all return 1 until i get this fixed) any help is appreciated. <edit :: undid the [ code ] tags on the errors> <double edit :: i meant void instead of int - my bad> [Edited by - stormrunner on October 24, 2004 6:41:48 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:

virtual ~CRenderer() {}

// set up rendering states
virtual void BeginRendering(void) = 0;
// render everything to the back buffer
virtual void Render(void) = 0;
// clean up
virtual void EndRendering(void) = 0;


You should not make those functions virtual unless you know what you're doing.

Share this post


Link to post
Share on other sites
Quote:
Original post by stormrunner
i'm trying to make an interface for my renderer, so i can OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::BeginRendering(void)" (?BeginRendering@OGLRenderer@@UAEXXZ)

OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::Render(void)" (?Render@OGLRenderer@@UAEXXZ)

OGLRenderer error LNK2001: unresolved external symbol "public: virtual void __thiscall OGLRenderer::EndRendering(void)" (?EndRendering@OGLRenderer@@UAEXXZ)


In your interface you declared the methods as:

virtual void

While in the implementation you used:

int

Either change the interface to be virtual int, or the implementation to be void.

Share this post


Link to post
Share on other sites
first, thanks for the replies - i went through and fixed some things. now, though, i cleaned it and ran it again, and now i've got bizarre errors like these :

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C3209: '?'

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C2018: unknown character '0x3'

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C2146: syntax error : missing ';' before identifier 'U'

needless to say, i don't include WinNT.h. anyone know what is going on ?

Share this post


Link to post
Share on other sites
Quote:
Original post by stormrunner
first, thanks for the replies - i went through and fixed some things. now, though, i cleaned it and ran it again, and now i've got bizarre errors like these :

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C3209: '?'

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C2018: unknown character '0x3'

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinNT.h(1317): error C2146: syntax error : missing ';' before identifier 'U'

needless to say, i don't include WinNT.h. anyone know what is going on ?


"WinNT.h" is included in "windef.h" -- Basic Windows Type Definitions, which is included in "windows.h"


Perhaps you have troubles with your Visual Studio/Hard drive/Windows/Hardware
because line 1317 in WinNT.h is

#define DBG_CONTROL_C ((DWORD )0x40010005L)


P.S. I have exactly Microsoft Visual Studio .NET 2003

Share this post


Link to post
Share on other sites
thanks Archi. i checked the line, and several lines in WinNT.h have turned into this

#define DBG_TERMINATE_PROCESS ((DWO

followed by many unicode characters. this is not good. i should reinstall vs.net, methinks.

out of curiosity, anyone know how this could have happened ?

Share this post


Link to post
Share on other sites
Quote:
Original post by stormrunner
i checked the line, and several lines in WinNT.h have turned into this

#define DBG_TERMINATE_PROCESS ((DWO

followed by many unicode characters. this is not good. i should reinstall vs.net, methinks.

out of curiosity, anyone know how this could have happened ?


Anything could ruin your filesystem. It could be a virus, logical or physical bad sector on the hard drive, or simply "overlapping files". Scandisk can cure this, but it also can ruin FS. It also depends on the OS you're running.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement