Plug-In Development in Open-source Compilers (gcc, dev-cpp, djgpp)

Started by naltimari, Mon 18/02/2008 03:38:40

Previous topic - Next topic

naltimari

I'm trying to compile a plug-in that uses AGS' IManagedObject interface in dev-cpp, but it's crashing AGS upon startup.

I'm almost sure that it is due to a different (incompatible) binary layout between VC++ and dev-cpp, because the same code runs fine when I compile it in VC++. Also, if I try to compile a plugin which does not use C++ in dev-cpp, it works in AGS. So, my guess would be name-mangling/binary layout incompatibilities.

I know CJ was explicit about using VC++ for plugins, but I wonder if it wouldnt be a matter of setting the right compiler switches to make things work.

Anyone has any clue about it?

Radiant

Perhaps.

Have you tried the various settings for memory models and function calling conventions?

naltimari

Well, I tried to change some options in dev-cpp, but there arent many, and none of them worked.

dev-cpp is mostly a GUI for MinGW's gcc, but there are a lot of gcc switches that dont show up in its interface. But one can pass compiler switches directly to gcc, on the command line, as long as one KNOWS how they work, which is not my case... :)

Can you point me to what specific switches you are referring to?

Radiant

I don't know them by name since I tend to use GUIs for this. But I was referring to the difference between cdecl, stdcall and fastcall. See http://en.wikipedia.org/wiki/Fastcall

Pumaman

It probably is a calling convention thing. The AGS interface API's use STDCALL, but this is set by the header file so should be ok.

Functions that you expose from the plugin (like AGS_EditorStartup)  should be CDECL.

Probably worth checking your compiler settings for both of those things.

SMF spam blocked by CleanTalk