Creating a Windows DLL from C ++ source files

I have several C ++ source files with which I want to create a dynamic link library.

I see this happening on linux with gcc -shared and ln

however, for Windows, I assume that I will have to modify the source files to create the DLL.

Is there a way to generate a DLL (a file similar to * .so on linux) with the provided source files. Please correct me, if I am wrong, I think it is. Dll for linux.

The reason for this is the use of SWIG to call C ++ functions in python on Windows Platfrom. I am stuck on a step that requires me to generate dlls in windows.

+3
source share
3 answers

, , , , . , DLL Visual Studio, .

+4

DLL, - DLL,

__ declspec (dllexport) void __cdecl SomeFunction (int a, int b);

+2

? Visual ++ , , :

link -nologo -dll -out:mylib.dll -implib:mylib.lib myobj1.obj myobj2.obj ...

-D , .

+1

Source: https://habr.com/ru/post/1720740/


All Articles