I want to create a custom Node class. I subclass PandaNode in a new MyNode.h
and MyNode.cxx
:
#include "pandaNode.h"
class EXPCL_PANDA_PGRAPH MyNode : public PandaNode {
PUBLISHED:
MyNode(std::string name);
public:
~MyNode();
};
#include "MyNode.h"
MyNode::MyNode(std::string name):PandaNode(name){}
MyNode::~MyNode() {}
This node doesn’t really do anything. I just want to see if I am doing it right.
After I rebuild Panda (I use cmake
branch btw), in the new project I include the MyNode.h
and write:
MyNode* mn = new MyNode();
But linker doesn’t see my class:
LNK2001 unresolved external symbol "__declspec(dllimport) public: virtual __cdecl MyNode::~MyNode(void)" (__imp_??1MyNode@@UEAA@XZ)
LNK2001 unresolved external symbol "__declspec(dllimport) public: __cdecl MyNode::MyNode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (__imp_??0MyNode@@QEAA@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
I am a C++ noob, so maybe it’s a simple thing that I don’t understand.
EDIT:
This has nothing to do with macros, but with build system.