1

We have built our project into a .out file using cygwin. We have to call functions from that project using python script. For that we need .dll file.

Is there any way or command to convert a .out file into a .dll using cygwin?

Thanks in advance.

pak
  • 855
  • 8
  • 20
  • What is the format of the `.out` file? A `.dll` is usually created from a language like C, C++, or C#, not Python. (`out` is a C# keyword) – cdarke Mar 26 '15 at 08:12
  • our .out is created form C language – Manikandan A Mar 26 '15 at 08:54
  • we want to call functions of C from python by loading .dll of C file into python like: lib=ctypes.CDLL("file.dll").We have only .out file of that C file.So kindly suggest how to convert that .out into .dll in cygwin – Manikandan A Mar 26 '15 at 09:21
  • Aha! I see now, a.out is the default executable name from gcc. How was it compiled, and does it have a `main()` function? If it does, then it can't be a DLL. Does the C code use the Python API? If not, then you will need to use the `ctypes` standard library. – cdarke Mar 26 '15 at 14:14

1 Answers1

1

It sounds like you have an executable compiled with default arguments (often named things like a.out). I'm not sure that you can convert this to a .dll without some difficulty.

Do you have access to the source code? In which case, you can follow this example, as given in 0x90's answer.

Community
  • 1
  • 1
Kyle_S-C
  • 1,107
  • 1
  • 14
  • 31
  • In that case, you need to build it into a .dll, as described in the linked example or, if you want to do it just with cygwin (without Visual Studio), then try [this](https://cygwin.com/cygwin-ug-net/dll.html). – Kyle_S-C Mar 26 '15 at 14:04