Skip to content
Advertisement

how to write C++ DLL file for python correctly?

this is my test.cpp file.(I also used makefile to create dll file)

JavaScript

when I run following code in python

JavaScript

everything is ok and I get this output from python.

JavaScript

but when I change my test.cpp in this way(I just uncommented iostream):

JavaScript

I get the following error from python.

JavaScript

this is also my dependencies enter image description here

by the way I have to mention that when I use Linux, everything is just fine.(I just used .so files) but there might be some problem with windows

I appreciate your help.

Advertisement

Answer

thanks to @DhirajWishal first I added the following line in my makefile.

JavaScript

then I placed libwindpthread-1.dll (which was in F:/strawberry/c/bin/ dir ) next to my makefile and the problem was solved.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement