Jump to content


Photo

GMAPI v0.0.7 2012/09/28


  • Please log in to reply
84 replies to this topic

#81 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 28 September 2012 - 10:09 PM

Released 0.0.7. In addition to zip I also provided 7z archives this time which are notably smaller. Nothing much extra from the recent SVN revisions.

Although the archives contain Code::Blocks and GCC related files, GCC builds do not currently work. For anyone using an older release build in there extensions, Id suggest upgrading to get fixed external_call hook code (now V3).

On that note, if you feel the need to customise anything related to that and how multiple instances interact, please do it in a compatible way with other extensions, e.g. let the user choose to prioritise your custom hook and the "official"/other ones, e.g. by setting your version to 0 or UINT_MAX, and instead of extending/altering the Share struct create another shared memory allocation if you need to. Once 1.0.0 is released I'm hoping to go for full forwards/backwards compatibility on this (i.e. a user can have extensions using/built-for GMAPI 1.0, GMAPI 1.5, GMAPI 3.1, etc and everything works nicely together).

Edited by SyncViews, 28 September 2012 - 10:14 PM.

  • 0

#82 DFortun81

DFortun81

    The Fortunate One

  • GMC Member
  • 888 posts

Posted 13 October 2012 - 04:10 AM

GMAPI seems to be missing something...

1>Compiling...
1>main.cpp
1>Linking...
1>   Creating library D:\Data\Source\C++\gmLua_GM81\Release\gmLua81.lib and object D:\Data\Source\C++\gmLua_GM81\Release\gmLua81.exp
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl gm::newStr(unsigned int,unsigned short,unsigned short)" (__imp_?newStr@gm@@YAPADIGG@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) char * __cdecl gm::newStr(void const *,unsigned int,unsigned short,unsigned short)" (__imp_?newStr@gm@@YAPADPBXIGG@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl gm::shutdown(void)" (__imp_?shutdown@gm@@YAXXZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl gm::releaseStr(char const *)" (__imp_?releaseStr@gm@@YAXPBD@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct gm::Instance * __cdecl gm::getSelf(void)" (__imp_?getSelf@gm@@YAPAUInstance@1@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) struct gm::Instance * __cdecl gm::getOther(void)" (__imp_?getOther@gm@@YAPAUInstance@1@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl gm::strIncRef(char const *)" (__imp_?strIncRef@gm@@YAXPBD@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void * * gm::functions" (__imp_?functions@gm@@3PAPAXA)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl gm::init(double)" (__imp_?init@gm@@YA_NN@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class gm::Value __cdecl gm::docall(void *,struct gm::Instance *,struct gm::Instance *,unsigned int,class gm::Value *)" (__imp_?docall@gm@@YA?AVValue@1@PAXPAUInstance@1@1IPAV21@@Z)
1>D:\Data\Source\C++\gmLua_GM81\Release\gmLua81.dll : fatal error LNK1120: 10 unresolved externals
1>Build log was saved at "file://d:\Data\Source\C++\gmLua_GM81\gmLua\Release\BuildLog.htm"

I'm working on porting over gmLua to GM 8.1 and it was going great until I discovered the script_execute problem in 0.0.6. Saw you posted about it, so I downloaded, reinstalled, compiled. Disabled D3D, compiled. Compiled correctly into GMAPI.dll.

Relinked my gmLua C++ DLL with the new GMAPI 0.0.7 version, but it appears to be missing something... O.o


Edit: I'm an idiot. 3 seconds after posting this, I checked the Linker settings to discover that I had been including a misspelled gmapi-mt-d.lib rather than gmapi.lib. (When I compiled 0.0.6 that last time, I was using the -mt tag.)

Problem solved!

Edited by DFortun81, 13 October 2012 - 04:14 AM.

  • 0

#83 ChaosMaker

ChaosMaker

    GMC Member

  • GMC Member
  • 288 posts
  • Version:GM:HTML5

Posted 22 October 2012 - 06:20 PM

im using game maker 8.0when i try to call dll functions
occurs this error
"Unexpected Error Ocurred"

my dll

#include <gmapi.hpp>
#include <windows.h>

#define EX extern "C" __declspec(dllexport)

EX double alert(char *str)
{
	gm::init(1);
	gm::show_message(str);
	return(0);
}


a=external_define("GMAPI8.1.dll","alert",dll_stdcall,ty_real,1,ty_string);

external_call(a,"LOL");

this gmapi work with gms [windows] ?

Edited by ChaosMaker, 22 October 2012 - 06:20 PM.

  • 0

#84 SyncViews

SyncViews

    GMC Member

  • GMC Member
  • 392 posts

Posted 22 October 2012 - 06:36 PM

You cant call gm::init with a value like that, its completely undefined.

You need 8.1 with get_function_address and pass the result of get_function_address("get_function_address").
EXPORT double init(double get_function_address)
{
    if (gm::init(get_function_address))
    {
        return true;
    }
    else return false;
}
GM:
init = external_define(global.dll, "init", dll_cdecl, ty_real, 1, ty_real);
external_call(init, get_function_address("get_function_address"));


EDIT: I considered supporting (or at least looking at to the extent of being able to prove its impossible) all the platforms that have native code on GMS (iOS, Android, Mac and Windows IIRC) however have not had any personal reason at all to pay yoyo's licensing fees at their current rates.

Edited by SyncViews, 22 October 2012 - 06:41 PM.

  • 0

#85 DFortun81

DFortun81

    The Fortunate One

  • GMC Member
  • 888 posts

Posted 06 January 2013 - 02:47 AM

I would love to see a GM:S Windows port for this... It would make gmLua's porting so much easier.

It doesn't even need to be a full port either. The only functions I need access to are as follows:

ds_list_size
ds_list_clear
ds_list_add
ds_list_find_value
script_execute


I would love you forever.

Edited by DFortun81, 06 January 2013 - 03:42 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users