IRIX MipsPro compiler chokes on Python.h

B

Bram Stolk

Hi there,

I just built and installed Python-2.4.1 on my Irix machine.
My compiler, the MipsPro compiler, chokes on the Python.h include file,
as demonstrated here:


$ CC -v
MIPSpro Compilers: Version 7.41
$ python -V
Python 2.4.1
$ cat l.cxx
#include <Python.h>

int main()
{
return 0;
}

$ CC -I $HOME/include/python2.4 l.cxx
cc-1311 CC: ERROR File = /usr/include/sys/time.h, Line = 186
The indicated linkage specification is incompatible with previous "select"
(declared at line 479 of "/usr/include/unistd.h").

static int select(
^

1 error detected in the compilation of "l.cxx".

Has anyone experienced the same?
How do I solve this?

Thanks,

Bram Stolk
 
D

Dennis Lee Bieber

$ cat l.cxx

Isn't ".cxx" a "C++" indicator? I think Python is just plain C,
so you'd have to wrap everything to indicate C style naming in the
compiler output.

--
 
A

Andrew MacIntyre

Bram said:
Hi there,

I just built and installed Python-2.4.1 on my Irix machine.
My compiler, the MipsPro compiler, chokes on the Python.h include file,
as demonstrated here:


$ CC -v
MIPSpro Compilers: Version 7.41
$ python -V
Python 2.4.1
$ cat l.cxx
#include <Python.h>

int main()
{
return 0;
}

$ CC -I $HOME/include/python2.4 l.cxx
cc-1311 CC: ERROR File = /usr/include/sys/time.h, Line = 186
The indicated linkage specification is incompatible with previous "select"
(declared at line 479 of "/usr/include/unistd.h").

static int select(
^

1 error detected in the compilation of "l.cxx".

Has anyone experienced the same?
How do I solve this?

My suspicion would be directed to a #define that is incorrect, as the
snippet above suggests that select() appears in two system headers
(/usr/include/sys/time.h & /usr/include/unistd.h).

That is ./configure got something wrong and may need to be modified for
your platform to sort this out properly, but modifying pyconfig.h to
correct the incorrect definitions should get you out of trouble.
 
B

Bram Stolk

Dennis said:
Isn't ".cxx" a "C++" indicator? I think Python is just plain C,
so you'd have to wrap everything to indicate C style naming in the
compiler output.

extern "C"
{
#include <Python.h>
}

....gives the same result.

Bram
 
B

Bram Stolk

Andrew said:
My suspicion would be directed to a #define that is incorrect, as the
snippet above suggests that select() appears in two system headers
(/usr/include/sys/time.h & /usr/include/unistd.h).

thanks for the info.
I need to undef the following from my pyconfig.h to make it pass the
compiler:

HAVE_SYS_TIME_H
TIME_WITH_SYS_TIME

Bram
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top