473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

"initializer element is not constant"

When trying to compile python extensions written in C using "python
setup.py build" on cygwin I get the following error:

foo.c: initializer element is not constant
foo.c: error: (near initialization for `FooType.ob_type')

I remember someone telling me a long time ago that this had something
to do with declspec and how dlls are imported on cygwin/python. Can
someone give me a pointer to how to build python extensions on cygwin?

Thanks

May 30 '06 #1
1 2956
em************@gmail.com wrote:
When trying to compile python extensions written in C using "python
setup.py build" on cygwin I get the following error:

foo.c: initializer element is not constant
foo.c: error: (near initialization for `FooType.ob_type')

I remember someone telling me a long time ago that this had something
to do with declspec and how dlls are imported on cygwin/python. Can
someone give me a pointer to how to build python extensions on cygwin?


Essentially, Python and its extensions must be compatibly compiled.
The distributed Windows python is compatible with MS C/C++ and (as a
result) also compatible with the Intel C/C++ compilers. In addition,
"MinGW" (Minimal GNU for Windows) can compile C source to be compatible
with and use the MS C runtimes. If you really want cygwin, you need to
compile the whole of Python with cygmin (I've no idea if that compile
cleanly). If you want to use the MinGW approach, your call to setup is
something like "python setup.py -compiler=mingw32 -build " (look it up,
there are more details to know about.

--Scott David Daniels
sc***********@acm.org
May 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ReignMan | last post by:
I'm running JDK 1.4.0_01, Xalan2.5.1 and Tomcat 4.1.27. XSL transformations work, yet when running in debug mode (Eclipse IDE), I get the following: 990S2html.xsl:3:80: Element type...
2
by: Todd Nathan | last post by:
Hi. have this code and compiler problem. GCC 2.95.3, BeOS, error "initializer element is not constant" #ifdef FILEIO { static struct { char *sfn; FILE *sfd; } stdfiles = {
9
by: Player | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all. I am in the process of teaching myself C# and I think I am doing OK. I have learnt how to how to call the right constructor of a...
1
by: tankbattle | last post by:
That is, what's the difference between <complexType name="Address" final="restriction"> <sequence> <element name="name" type="string"/> <element name="street" type="string"/> <element...
3
by: mettle | last post by:
I'm trying to define a bunch of consant global variables in C, but I'm getting a "initializer element is not constant" error I think because I'm trying to define one in terms of the other. The...
4
by: jaime | last post by:
Hi again all. Given the line: const int x=5; Can I then use "x" as a constant expression? (By "constant expression", I mean "constant expression" as defined in the C99 standard) I've been...
2
by: hankypan1 | last post by:
Hi All, I need a tree data structure for my application. It is the non - cyclic simple tree where i can have any number of children node and each child can recursively become a sub tree like a...
13
by: bobg.hahc | last post by:
running access 2k; And before anything else is said - "Yes, Virginia, I know you can NOT use a variable to set a constant (that's why it's constant)". BUT - my problem is - I want a constant,...
3
by: zoeb | last post by:
Hi, I am declaring an array which carries x coordinates, however these will vary depending on the geometry the user enters. I have set my code up as follows, but get the "initializer element...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.