I'm quite new to Cython.
I ran the examples succesfully, but I then tried to get a little
further.
Here is my problem.
I created a DLL in C which creates and opens a window with the SDL,
and sets up an OpenGL 3.2 context for me.
I stored all the useful datas in a struct.
I have 2 simple functions: createCtx(), deleteCtx().
As I code on Windows XP, I specified the dllexport flag before each
symbol. Anyway, my DLL compiles good, and I can use it in a C
application.
I then followed the example available on docs.cython.org:
I created a .pxd file, with the usual "cdef extern from myLib.h:" and
rewrote my declarations as such:
cdef extern from "GLSDLCTX.h":
ctypedef struct GLSDLHANDLERS:
pass
ctypedef struct GLSDLCTX:
pass
etc...
I then wrote the actual wrapper around my class as such:
cimport python_exc
cimport cGLSDLCTX
cdef class GlCtx:
cdef cGLSDLCTX.GLSDLCTX * _ctx
def __cinit__(self):
self._ctx = cGLSDLCTX.createCtx()
if self._ctx is NULL:
python_exc.PyErr_NoMemory()
def __dealloc__(self):
if self._ctx is not NULL:
cGLSDLCTX.deleteCtx(self._ctx)
I created a build.py carefully, and it all compiles cleanly, without
any error. I get a nice myModule.pyd
But here is my problem:
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
(Intel)] on win32
>>> import myModule
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: specified procedure could not be found.
>>>
I really tried everything. Tweaking the sys.path, copying every other
usefull DLL in the local directory etc... I don't understand what I
missed.
Python -v didn't really help to spot the actual DLL that causes
trouble. I'm really helpless right now, I can just hope that any of
you did get the same error at some point and found a workaround.
Thanks,
Lionel
http://www.dependencywalker.com/
PS: The whole business of DLL's, SxS assemblies, manifests, and all
that nonsensical crap is something I still to not fully understand, so
try to use depends.exe utility to try to figure out what's wrong with
your DLL dependencies.
--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
--
To unsubscribe, reply using "remove me" as the subject.
Perhaps that error message does not came for Python itself, but from a
failing (likely because of missing dependency) LoadLibrary() call when
Python imports your module?
1) Missing DLL on your system (C:Win\Sys32 of SxS assembly).
2) Missing library in your setup.py
3) Mangling (perhaps because of calling conventions) issue.
That's the things I can think of with the info at hand.
Y think you have to pass the full -LC:\path\to\libdir to the import
library at build time, and make sure the actual DLL is in
C:\Win32\Sys32 or other standard locations... Sorry, I cannot help
further, I know almost nothing about Windows.
:: 1/ C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K [your batch script]
:: ex:C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K make.bat
:::::::::::::::::::::::::::::::::::::::::::
:: in make.bat file:
::::::::::::::::::::::::::::::::::::::::::
:: 2/ call vcvars32.bat
::
:: 3/ call setenv /x86 /Release
:: you could find setenv.cmd under windows sdk7
:: ex: D:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv
::
:: 4/ set DISTUTILLS_USE_SDK = 1
::
:: 5/ setup your program
::
:: 6/ python setup.py build_ext --inplace --compiler=msvc
--
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.