Public Group

# 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.

## 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 on other sites
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 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 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 on other sites
Quote:
 Original post by krumIts 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 on other sites
Quote:
 Original post by SiCraneIt 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]

anyone?

##### Share on other sites
SiCrane, u rock :)

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

1. 1
Rutin
35
2. 2
3. 3
4. 4
5. 5

• 12
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633340
• Total Posts
3011421
• ### Who's Online (See full list)

There are no registered users currently online

×