THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/08/2011 at 04:25, xxxxxxxx wrote:
I want to write a module for c4d using Cython, but importing the compiled module fails with "DLL %1 is not a valid win32 executable" when using with Cinema 4d 64 Bit.
I created a libpython26.a using dlltool and my gcc-command looks like this:
gcc __init__.pyx -shared -o test_a.pyd -I"C:\Program Files\MAXON\Cinema 4D\resource\modules\python\res\Python.Win64.framework\include" -L"C:\Program Files\MAXON\Cinema 4D\resource\modules\python\res\Python.Win64.framework\libs" -lpython26
Am i missing something ?
On 13/08/2011 at 10:49, xxxxxxxx wrote:
I am not really sure, but I guess it is like this:
If you compile for Cython, you can only run it with Cython. If you compile a dll, you will be able to use it within python.
On 14/08/2011 at 09:51, xxxxxxxx wrote:
Here is another enlightenment I had:
>>Is a *.pyd file the same as a DLL?
>>Yes, .pyd files are dll's, but there are a few differences. If you have a DLL named foo.pyd, then it must
>>have a function initfoo(). You can then write Python "import foo", and Python will search for foo.pyd
>>(as well as foo.py, foo.pyc) and if it finds it, will attempt to call initfoo() to initialize it. You do not link
>>your .exe with foo.lib, as that would cause Windows to require the DLL to be present.