Adding an extra include in the generated c code

21 views
Skip to first unread message

Marcelo CB

unread,
Oct 6, 2017, 3:23:40 AM10/6/17
to cython-users
Hi, 

I am building a module that uses opengl on a win10 machine, using Visual C++ 2008 for python 2.7.

Unfortunately, to be able to build I have to manually generate the c code; edit the .c file to add  [ #include "windows.h" ], before the GL includes; compile; link. 

Is there an option to force the  [ #include "windows.h" ] to be generated (at the right place!) using the distutils process? 

Thanks,

Marcelo.

Hai Nguyen

unread,
Oct 6, 2017, 10:22:32 AM10/6/17
to cython...@googlegroups.com
I am nosorry at computer right now, so here is my guess

cdef extern from "your.h":
    pass

Then put your includ in your.h

Hai

Thanks,

Marcelo.

--

---
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/d/optout.

Stefan Behnel

unread,
Oct 7, 2017, 2:42:15 AM10/7/17
to cython...@googlegroups.com
Hai Nguyen schrieb am 06.10.2017 um 16:22:
> On Fri, Oct 6, 2017 at 3:23 AM Marcelo CB wrote:
>> I am building a module that uses opengl on a win10 machine, using Visual
>> C++ 2008 for python 2.7.
>>
>> Unfortunately, to be able to build I have to manually generate the c code;
>> edit the .c file to add [ #include "windows.h" ], before the GL includes;
>> compile; link.
>>
>> Is there an option to force the [ #include "windows.h" ] to be generated
>> (at the right place!) using the distutils process?
>>
>
> I am nosorry at computer right now, so here is my guess
>
> cdef extern from "your.h":
> pass
>
> Then put your includ in your.h

Or just

cdef extern from "windows.h":
pass

cimport opengl_whatever

Stefan

Marcelo CB

unread,
Oct 9, 2017, 1:18:09 AM10/9/17
to cython-users
Thanks, that worked out!
Reply all
Reply to author
Forward
0 new messages