SA-MP Forums Archive
Any tutorial about this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: Any tutorial about this? (/showthread.php?tid=328684)



Any tutorial about this? - ShOoBy - 25.03.2012

Erm , hello
I was wonering if it is a tutorial on this forum , about creating a plugin in MinGw. I use MinGw because the compiling time is much much much faster than C++ or C#. But it's a little bit strange , for example I cant find the option for creating a .dll file ...
So can anyone give me a tutorial with this?


Sorry for my bad english and/or if I posted in the wrong section



Re: Any tutorial about this? - T0pAz - 26.03.2012

DLL is also known as Class Library or Dynamic Link Library which cannot be executed. Maybe creating a blank project then setting the output type to DLL.


Re: Any tutorial about this? - russo666 - 28.03.2012

I'm not sure if I correctly understood your question, but here is goes:

Код:
Example: 
For the file helloworld.cpp in the folder C:\docs\hello enter the command

         cd c:\docs\hello

Now type the compile command

         g++ helloworld.cpp -o helloworld.exe

The -o switch defines the name of the output file, without it the output file would be a.exe.
Remember to change the extension.

Source: http://www.mingw.org/wiki/MinGWforFirstTimeUsers


Re: Any tutorial about this? - ShOoBy - 01.04.2012

Never mind , I found the answer:

Код:
Building the DLL
To build the DLL use the following commands:

g++ -c -DBUILDING_EXAMPLE_DLL example_dll.cpp
g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a

The -DBUILDING_EXAMPLE_DLL compiler option causes the DLL's functions to be declared as "dllexport", meaning that they will be "exported" from the DLL and available to client applications. The "-shared" option tells the linker to create a DLL instead of an .exe, and the "--out-implib" linker option causes an import library to be created, which is used later on.

Note:

The import library created by the "--out-implib" linker option is required iff (==if and only if) the DLL shall be interfaced from some C/C++ compiler other than the MinGW toolchain. The MinGW toolchain is perfectly happy to directly link against the created DLL. More details can be found in the ld.exe info files that are part of the binutils package (which is a part of the toolchain).
But I dont use MinGw anymore .. it's just to different from other Programs.


Re: Any tutorial about this? - bashar0151 - 14.04.2012

on ******* maby


Re: Any tutorial about this? - KarlMann - 30.06.2012

I'm not sure whether I understand your problem......