Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / How to get the function "?ReceiveCoreDataPtr@@YAXPAX@Z" correctly seen using code::blocks?

Author
Message
Chris66
15
Years of Service
User Offline
Joined: 12th Aug 2009
Location:
Posted: 3rd Dec 2010 18:29
Hi all,

I am using code::blocks (MinGW) and I can't get this function to be seen by DBP when using my dll.

I read all explanations given for DevC++ from this topic : http://forum.thegamecreators.com/?m=forum_view&t=55588&b=18 and I tried to use the same approach with code::blocks but the IDE seems to manage things in a different way : linking with a .def file doesn't make my dll to work.

There's no errors with the compilation of my dll but I know the core is not available because I'am using the following code (which always returns the "Core not set" message when calling my function from DBP) :




Here is a part of the dll code (I removed all the functions except the one that need the core):




And here is the Stringtable:




These are the original files of my dll, I don't post the modified versions I made of the stringtable and the .def file as they don't work much more.

Any help or comment is welcome to get the core to be "seen".

Thanks!

Chris
Chris66
15
Years of Service
User Offline
Joined: 12th Aug 2009
Location:
Posted: 4th Dec 2010 17:06
I reply to myself as I solved the problem and this could be useful for other programmers.


As described for DevC++, a .def file is required BUT code::blocks doesn't work exactly the same way DevC++ does.

So adding the code
to the linker option doesn't work.


To get the .def file linked correctly we have to pass only the name of this file (e.g. 'Project1.def' without the '--def ' prefix) as parameter into :

Project -> Build Options -> Linker Settings (tab) -> "Other linker options"

So, just add this code :



Then build the project...
Now, you've got a working dll that allows to use core functions.


Just for informations here's the content of my 'Project1.def' file:




And here is a copy of the modified globstruct.h file (for those who don't need to install the DirectX SDK and are using MinGW) :





NB: I'am using code::blocks 8.02, I didn't try the lastest version (V10.05 - 30 may 2010) yet.

Hope this will help.
Cheers,

Chris

Login to post a reply

Server time is: 2024-11-23 20:13:18
Your offset time is: 2024-11-23 20:13:18