Extension compiler and external DLLs
Hi, I would like to use pypy/bin/compilemodule.py to compile some of my code, which uses OpenGL. I am wondering why the following does not work (Link error on glEnd) : from ctypes import windll glEnd = windll.opengl32.glEnd glEnd.restype = None def DrawSomething(space): glEnd() While this does compile fine: from pypy.rpython.rctypes.tool import ctypes_platform from pypy.rpython.rctypes.tool.libc import libc from ctypes import * time_t = ctypes_platform.getsimpletype('time_t', '#include <time.h>', c_long) time = libc.time time.argtypes = [POINTER(time_t)] time.restype = time_t def DrawLine(space): time(None) Any help would be much appreciated. Thanks, Laurent Destriau
On 8/25/06, laurent destriau <laurent.destriau@gmail.com> wrote:
Hi, I would like to use pypy/bin/compilemodule.py to compile some of my code, which uses OpenGL. I am wondering why the following does not work (Link error on glEnd) :
from ctypes import windll
glEnd = windll.opengl32.glEnd glEnd.restype = None
def DrawSomething(space): glEnd()
You should provide more information about your errors so it could be easier to help you. Anyway I guess the compiler doesn't find the C header in which glEnd() is defined. Do you have the headers of the opengl library on the machine? ps. do you know there is a opengl-ctypes implementation, right? -- Lawrence http://www.oluyede.org/blog
Thank you for your answer. Here is some more info: - I use Visual C++ .Net 2003, which includes the OpenGL header - I get the following warning: "warning C4013: glEnd not defined ; extern returning int assumed" - I get the following error: "error LNK2001: unresolved external symbol _glEnd" How can I tell the extension compiler how to find the proper headers/libraries?
ps. do you know there is a opengl-ctypes implementation, right?
No, I didn't. Thanks for the tip. -- Laurent Destriau On 8/25/06, Lawrence Oluyede <l.oluyede@gmail.com> wrote:
On 8/25/06, laurent destriau <laurent.destriau@gmail.com> wrote:
Hi, I would like to use pypy/bin/compilemodule.py to compile some of my code, which uses OpenGL. I am wondering why the following does not work (Link error on glEnd) :
from ctypes import windll
glEnd = windll.opengl32.glEnd glEnd.restype = None
def DrawSomething(space): glEnd()
You should provide more information about your errors so it could be easier to help you. Anyway I guess the compiler doesn't find the C header in which glEnd() is defined. Do you have the headers of the opengl library on the machine?
ps. do you know there is a opengl-ctypes implementation, right?
-- Lawrence http://www.oluyede.org/blog
On 8/26/06, laurent destriau <laurent.destriau@gmail.com> wrote:
Thank you for your answer. Here is some more info: - I use Visual C++ .Net 2003, which includes the OpenGL header - I get the following warning: "warning C4013: glEnd not defined ; extern returning int assumed" - I get the following error: "error LNK2001: unresolved external symbol _glEnd"
Mmm that's happened to me too but I'm still looking for the solution
How can I tell the extension compiler how to find the proper headers/libraries?
Look at the definition of CConfig in this file: http://codespeak.net/svn/pypy/dist/pypy/module/readline/c_readline.py I have to admit it didn't work for me... -- Lawrence http://www.oluyede.org/blog
participants (2)
-
laurent destriau
-
Lawrence Oluyede