linkin probelem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
mariusz_p
Posts: 15
Joined: Tue Jan 06, 2004 9:37 pm

linkin probelem

Post by mariusz_p »

I have added some method to be able to attach IrrLicht to existing window, but it seems to be a problem. Compilation runs Ok, but i can't link my program with library.

My newly added function is called AttachDevice, i look at the dll under dependency walker and my method is there - so it seems to be allright. But linker says that it cannot find it. I just don't get it. Maybe there is something wrong with exporting the function dll? But i'v made it in the same way that createdevice is exported.

I know that this is stupid question, but i don't have any ideas.

This is my error code:

MFCDialoG error LNK2019: unresolved external symbol "__declspec(dllimport) class irr::IrrlichtDevice * __cdecl irr::AttachDevice(enum irr::video::EDriverType,struct HWND__ *,unsigned int,bool,class irr::IEventReceiver *,wchar_t const *)" (__imp_?AttachDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@PAUHWND__@@I_NPAVIEventReceiver@1@PB_W@Z) referenced in function "public: int __thiscall CMFCDialoGDlg::InitIrrlicht(void)" (?InitIrrlicht@CMFCDialoGDlg@@QAEHXZ)

and this is my function

Code: Select all

IRRLICHT_API IrrlichtDevice* AttachDevice(
	video::EDriverType deviceType,HWND _hWnd, 
	u32 bits,
	bool stencilbuffer,
	IEventReceiver* receiver,
	const wchar_t* sdk_version_do_not_use)
{....}
I'm trying to write the code that will attach the IrrLIcht to the MFC...actually i don't know if my method will work, but i won't know it if i don't check it ;)
mariusz_p
Posts: 15
Joined: Tue Jan 06, 2004 9:37 pm

Post by mariusz_p »

I'v took a look at the exact function name in error code and in dependency walker and it seems that there is a little difference.

?AttachDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@PAUHWND__@@I_NPAVIEventReceiver@1@PBG@Z
?AttachDevice@irr@@YAPAVIrrlichtDevice@1@W4EDriverType@video@1@PAUHWND__@@I_NPAVIEventReceiver@1@PB_W@Z)


At the last place there is little difference, but i don't know why.
tstuefe
Posts: 40
Joined: Wed Jan 07, 2004 12:53 pm
Location: Heidelberg, Germany
Contact:

Post by tstuefe »

mariusz_p
Posts: 15
Joined: Tue Jan 06, 2004 9:37 pm

Post by mariusz_p »

Hi Thomas. Thanx for the link but this just doesn't work for me. Instead i'v just changed AttachDevice and removed last variable. And suddenly it started to work. Actually i just don't understand this.

But anyway - right now my MFC attach device doesn't wont to work properly. I think i will have to look more closely to the problem....
Post Reply