Jump to content
  • Advertisement
Sign in to follow this  
lem77

dll linking problem with derived class

This topic is 4847 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

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
SiCrane, u rock :)

Linker had problems with undeclared virtual destrucor of the base class.
I splitted the CEffect and CEffectManager into seperated files, and then i still had a linker error, but with "better" error message, that destructor couldn´t be found.

Thanx a lot

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!