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.

Newcomers AppGameKit Corner / [SOLVED] #import_plugin what's wrong ?

Author
Message
Iosys
4
Years of Service
User Offline
Joined: 26th May 2019
Location:
Posted: 26th May 2019 20:02
hi, i m a noob ( and not a native english speeker, sorry about that )
i ve a trouble, i don't find what i miss
in code::block

DLL_EXPORT int SetI( int value )
{
return value*2;
}

result : 0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
it's OK ...

i copy it in "C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Tier 1\Compiler\Plugins\core"
as windows.dll and windows64.dll

next i used dependancy walker to have his dll function name, here it's : _Z4SetIi
i edited commands.txt and write in it :

Seti,I,I,_Z4Setxi,0,0,0,0

next in AppGameKit :

#import_plugin core
.
.
do
print(core.Seti(2))
Sync()
loop

result :
Exécution de C:\Program Files (x86)\Steam\steamapps\common\App Game Kit 2\Tier 1\Compiler\AGKCompiler.exe (dans le dossier : C:\Users\david\Dropbox\code\AGK\MiniGame)
Compilation terminée avec succès.
it's OK...

on execute i ve this error message box:
Failed to load ReceiveAGKPtr function from plugin "core", it's must be exported undecorated

thanks to help

The author of this post has marked a post as an answer.

Go to answer

Iosys
4
Years of Service
User Offline
Joined: 26th May 2019
Location:
Posted: 26th May 2019 20:10
edit :
next i used dependancy walker to have his dll function name, here it's : _Z4Setxi
i edited commands.txt and write in it :

Seti,I,I,_Z4Setxi,0,0,0,0

sorry for mistake
Iosys
4
Years of Service
User Offline
Joined: 26th May 2019
Location:
Posted: 27th May 2019 04:49
This post has been marked by the post author as the answer.
just :

extern "C" DLL_EXPORT int SetI( int value )
{
return value*2;
}


extern "C" DLL_EXPORT int ReceiveAGKPtr()
{ return 0;
}

and it's working

Login to post a reply

Server time is: 2024-03-28 20:55:10
Your offset time is: 2024-03-28 20:55:10