Any tutorial about this?
#1

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
Reply
#2

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.
Reply
#3

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
Reply
#4

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.
Reply
#5

on ******* maby
Reply
#6

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


Forum Jump:


Users browsing this thread: 2 Guest(s)