   initialize the base
  I'm trying to move a constructor definition from the header to cpp and I can't get it workWhen contained in header the class compiles fine.deck::deck(irr::scene::ISceneNode* parent,   irr::scene::ISceneManager* mgr,   irr::s32 id, bool test): irr::scene::ISceneNode(parent, mgr, id){//things}//after split//.hdeck(irr::scene::ISceneNode* parent,   irr::scene::ISceneManager* mgr,   irr::s32 id, bool test);//.cppdeck::deck(irr::scene::ISceneNode *parent,   irr::scene::ISceneManager *mgr,   irr::s32 id, bool test) :  irr::scene::ISceneNode(parent, mgr, id){//things}//after splitting I get a lot of linker cussing. deck.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) const deck::`vftable'{for `irr::io::IAttributeExchangingObject'}" (__imp_??_7deck@@6BIAttributeExchangingObject@io@irr@@@) referenced in function "public: __thiscall deck::deck(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int,bool)" (??0deck@@QAE@PAVISceneNode@scene@irr@@PAVISceneManager@23@H_N@Z)deck.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) const deck::`vftable'{for `irr::IReferenceCounted'}" (__imp_??_7deck@@6BIReferenceCounted@irr@@@) referenced in function "public: __thiscall deck::deck(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int,bool)" (??0deck@@QAE@PAVISceneNode@scene@irr@@PAVISceneManager@23@H_N@Z)deck.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) const deck::`vftable'" (__imp_??_7deck@@6B@) referenced in function "public: __thiscall deck::deck(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int,bool)" (??0deck@@QAE@PAVISceneNode@scene@irr@@PAVISceneManager@23@H_N@Z)deck.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) const deck::`vbtable'{for `irr::io::IAttributeExchangingObject'}" (__imp_??_8deck@@7BIAttributeExchangingObject@io@irr@@@) referenced in function "public: __thiscall deck::deck(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int,bool)" (??0deck@@QAE@PAVISceneNode@scene@irr@@PAVISceneManager@23@H_N@Z)deck.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) const deck::`vbtable'{for `irr::scene::ISceneNode'}" (__imp_??_8deck@@7BISceneNode@scene@irr@@@) referenced in function "public: __thiscall deck::deck(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int,bool)" (??0deck@@QAE@PAVISceneNode@scene@irr@@PAVISceneManager@23@H_N@Z)[Edited by - Calin on June 24, 2009 6:40:15 AM]
  The code you've posted is very minimalistic. Can you provide some more of the surrounding code? Like, say, the full .h and .cpp files? You've probably forgotten some detail, which is hard to tell without the full code.   ;  this is the classclass deck : public irr::scene::ISceneNode{irr::core::aabbox3d<irr::f32> Box;irr::video::S3DVertex Vertices[4096];irr::u16 indices[16000];irr::video::SMaterial Material;faces Geometry; int VCount;int FCount;public:void FillSquare(int x, int y, int z,bool Done);void Load(){int x;int y;int z;Geometry.GeometryCount(VCount,FCount);for(int i =0;i < VCount;i++){Geometry.VertexData(i,x,y,z);Vertices = irr::video::S3DVertex(x*20,y*20,z*20, 0,1,0,irr::video::SColor(100,100,(int)255/y,0), 0, 1);}int f1;int f2;int f3;for(int i =0; i<FCount;i++){Geometry.FaceData(i,f1,f2,f3);indices = f1;<br>indices = f2;<br>indices = f3;<br><br>}<br><br><br><br><br>Box.reset(Vertices[<span class="cpp-number">0</span>].Pos);<br><span class="cpp-keyword">for</span> (irr::s32 i=<span class="cpp-number">1</span>; i&lt;VCount; ++i)<br>Box.addInternalPoint(Vertices<span style="font-weight:bold;">.Pos);<br>}<br><br><br><br>deck(irr::scene::ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id)<br>: irr::scene::ISceneNode(parent, mgr, id)<br>{<br>Material.Wireframe = <span class="cpp-keyword">false</span>;<br>Material.Lighting = <span class="cpp-keyword">false</span>;<br>Geometry.Reset();<br>}<br><br><br><span class="cpp-keyword">virtual</span> <span class="cpp-keyword">void</span> OnRegisterSceneNode()<br>{<br><span class="cpp-keyword">if</span> (IsVisible)<br>SceneManager-&gt;registerNodeForRendering(<span class="cpp-keyword">this</span>);<br><br>ISceneNode::OnRegisterSceneNode();<br>}<br><br><br><span class="cpp-keyword">virtual</span> <span class="cpp-keyword">void</span> render()<br>{<br><br>irr::video::IVideoDriver* driver = SceneManager-&gt;getVideoDriver();<br><br>driver-&gt;setMaterial(Material);<br>driver-&gt;setTransform(irr::video::ETS_WORLD, AbsoluteTransformation);<br>driver-&gt;drawIndexedTriangleList(&amp;Vertices[<span class="cpp-number">0</span>],VCount, &amp;indices[<span class="cpp-number">0</span>], FCount);<br><br>}<br><br><br><span class="cpp-keyword">virtual</span> <span class="cpp-keyword">const</span> irr::core::aabbox3d&lt;irr::f32&gt;&amp; getBoundingBox() <span class="cpp-keyword">const</span><br>{<br><span class="cpp-keyword">return</span> Box;<br>}<br><br><span class="cpp-keyword">virtual</span> irr::u32 getMaterialCount() <span class="cpp-keyword">const</span><br>{<br><span class="cpp-keyword">return</span> <span class="cpp-number">1</span>;<br>}<br><br><span class="cpp-keyword">virtual</span> irr::video::SMaterial&amp; getMaterial(irr::u32 i)<br>{<br><span class="cpp-keyword">return</span> Material;<br>}<br>};<br><br></pre></div><!–ENDSCRIPT–><br>;  Is that in a DLL? The error indicates that you're trying to export a class from a DLL...   ;  yes, I didn't include the export lines.Quote:/*#ifdef _DECK#define DECKC  __declspec(dllexport)#else#define DECKC  __declspec(dllimport)#endif*/ class /* DECKC */deck : public irr::scene::ISceneNode{;  Are all your classes used in the DLL also exported as __declspec(dllexport)? In particular, all base classes of deck.As an aside - this is why exporting classes from DLLs is a mess and extremely unportable in C++...   ;  I usually do 1 exported class per dll. In this case it's a class that inherits (a  class from) irrlicht and contains a class object (faces Geometry). The dll doesn't have anything else but this class   ;Does this help?;Quote:Original post by ZahlmanDoes this help?I've seen you pointing at that in your earlier posts. I guess the problem is I don t know how to make the split of all those functions, the sintax makes me faint.[Edited by - Calin on June 27, 2009 10:13:39 PM]