dll linking problem with derived class
Hi all,
I´m building an engine for demo/gfx stuff. (edited: engine is compiled as dll).
In it I have two classes: a class interface CEffect (which I want my effects derive from) and a singleton-CEffectManager in ONE .h and ONE .cpp file. Everything fine so far.
Now I want to code my first effect (standard bitmap =D), which basicaly just shows a textured quad.
So I added two new files (CEffect_Standard_Bitmap.h and CEffect_Standard_Bitmap.cpp) and coded a function in CEffectManager which looks like this:
Now when I build my project compiling is fine, but then I get a link error:
Bibliothek 'bin\Debug/Lem3D_D.lib' und Objekt 'bin\Debug/Lem3D_D.exp' wird erstellt
effect.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: __thiscall Lem3D::CEffectStandardBitmap::CEffectStandardBitmap(void)" (??0CEffectStandardBitmap@Lem3D@@QAE@XZ)', verwiesen in Funktion '"public: class Lem3D::CEffect * __thiscall Lem3D::CEffectManager::BuildEffect(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int)" (?BuildEffect@CEffectManager@Lem3D@@QAEPAVCEffect@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00H@Z)'
bin\Debug/Lem3D_D.dll : fatal error LNK1120: 1 unaufgelöste externe Verweise
HELP please :)
[Edited by - lem77 on August 9, 2005 12:14:27 PM]
It sounds like it can't find the constructor for the class. Are you sure you defined it?
Also, you mention a DLL in the title, but don't mention what is in a DLL in your post.
Also, you mention a DLL in the title, but don't mention what is in a DLL in your post.
No problems seem to apparent here, might help posting the class declaration for CEffectStandardBitmap... At a quick guess I'd look at #ifndef statements (make sure u haven't got the same #ifndef in another header if u copy pasted between headers, done this a few times), the constructor (is there one that takes no parameters). Also try a clean build, on both projects.
Richard.
Richard.
Its hard to tell from your post exactly what's going on, but you might need to DLL export your class. Use the __declspec(dllexport) stuff (see the docs).
Quote:Original post by krum
Its hard to tell from your post exactly what's going on, but you might need to DLL export your class. Use the __declspec(dllexport) stuff (see the docs).
I did it for the CEffectManager, since I want that to be accesible from the client app. The CEffect/CEffectStandardBitmap should be internal classes handled by the manager.
Quote:Original post by SiCrane
It sounds like it can't find the constructor for the class. Are you sure you defined it?
Also, you mention a DLL in the title, but don't mention what is in a DLL in your post.
These function and classes are part of the dll, or did I understand you wrong?
[Edited by - lem77 on August 9, 2005 12:07:55 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement