Compile a Plugin with MingW
#1

Hello,
I've just wanted to make a small plugin, so I've read some things, but i have problems to get them work.
First, i downloaded the invoke example and compiled it, which doesn't worked at all, because
MinGW told me some errors and stuff.

After I "fixed" (my C knowledge isn't very big) these errors, i got the DLL file.
So, i put the plugin into the server (which is running on a Windows XP computer), but then the server says:
Plugin does not conform to architecture.
Failed.

My "fixed" version of the invokeexample (which compiles without errors and warnings):
http://www.sendspace.com/file/hw7zm8

The errors i got before i "fixed" them:
http://www.imghoster.net/archiv.php?...rrorsWT4DB.jpg

Compiling Environment:
Windows XP Home
MinGW Version 3.4.5 (mingw vista special)
IDE: Code::Blocks

I would be happy if you can help me
Reply
#2

Hehe, I was trying to compile helloworld on CodeBlocks few weeks ago and got the same errors

To fix errors about __int64, size_t, etc. go to Project -> Build options -> Compiler Settings, #defines tab and add these defines:
Код:
HAVE_STDINT_H
__need_size_t
With this you don't need to change anything in SDK files.

And about "Plugin does not conform to architecture." error.
First go to Project -> Properties -> Build Targets tab and select "Create .DEF exports file".
Then go to Build Options again but now you need Linker Settings tab, put this line to Other Linker Options:
Код:
-Wl,--kill-at --def=name_of_def_file.def // don't forget to change the name
Then build again.

If you don't have .def, build the project, then find def file and change its name in linker options.

Good luck!
Reply
#3

Thank you so much for the good explanation!
I'll try it now

Edit:

You're awesome! You've made my day
Oh, and i've uploaded the working example so others with the same problem can use it
http://www.sendspace.com/file/styhl8

EditІ:

So, the plugin is working, it can output data via logprintf and stuff, but i can't Invoke PAWN Functions.
PawnCommand does not find the function named "GetPlayerPos"?? (I've added a printf before the return to check that)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)