locked
C++/CX

    Question

  • #ifndef GAMESCREEN_H
    #define GAMESCREEN_H
    
    #include "Screen.h"
    
    ref class GameScreen sealed : public Screen
    {
    public:
    	GameScreen();
    	~GameScreen();
    
    public:
    	virtual void Initialize() override;
    	virtual void Update(float timeTotal, float timeDelta) override;
    	virtual void Render() override;
    };
    
    #endif
    
    
    
    
    
    
    
    
    
    
    #ifndef SCREEN_H
    #define SCREEN_H
    
    #include "DirectXBase.h"
    
    ref class Screen : DirectXBase
    {
    
    public:
    	virtual void Initialize();
    	virtual void Update(float timeTotal, float timeDelta);
    	virtual void Render() override;
    };
    
    #endif
    
    

    This is more of a C++ components extension question, but it's related to DirectX so I'll ask it here. I'm still having some trouble working with C++/CX and declaring ref classes. I'm getting some constructor-related linker errors from the GameScreen class. Any help?

    Error 3 error LNK2019: unresolved external symbol "private: __cdecl GameScreen::~GameScreen(void)" (??1GameScreen@@A$AAA@XZ) referenced in function

    Error 4 error LNK2001: unresolved external symbol "private: __cdecl GameScreen::~GameScreen(void)" (??1GameScreen@@A$AAA@XZ) C:\Users\Jeffery\Documents\Visual Studio 2012\Projects\SSS Engine\SSS Engine\Game.obj"public: virtual void __cdecl GameScreen::[Platform::IDisposable]::<Dispose>(void)" (?<Dispose>@?QIDisposable@Platform@@GameScreen@@U$AAAXXZ) C:\Users\Jeffery\Documents\Visual Studio 2012\Projects\SSS Engine\SSS Engine\System.obj

    Thursday, July 5, 2012 7:00 PM

Answers

  • Hello,

    I cannot reproduce your issue on my site. Would you please provide us the whole codes to reproduce this issue,

    You can upload your project to skydriver
    http://skydrive.live.com/

    It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by DualOpAmp Monday, July 9, 2012 3:46 PM
    Monday, July 9, 2012 9:07 AM
    Moderator

All replies

  • Hello,

    I cannot reproduce your issue on my site. Would you please provide us the whole codes to reproduce this issue,

    You can upload your project to skydriver
    http://skydrive.live.com/

    It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by DualOpAmp Monday, July 9, 2012 3:46 PM
    Monday, July 9, 2012 9:07 AM
    Moderator
  • It was extremely simple, just no implementation of the constructor.  Thanks, anyway.
    Monday, July 9, 2012 3:46 PM