Compiling C++ extensions with distutils on Cygwin

G

George Sakkis

I'm trying to build a C++ extension on Cygwin, but it fails because
distutils invokes gcc instead of g++. Looking into distutils internals,
it turns out that compilation is assumed to be independent of the
target language, while linking is not (CCompiler.compile() doesn't take
a target_lang argument but CCompiler.link() does). Is there a good
reason for this ?

George
 
J

Jorgen Grahn

I'm trying to build a C++ extension on Cygwin, but it fails because
distutils invokes gcc instead of g++. Looking into distutils internals,
it turns out that compilation is assumed to be independent of the
target language, while linking is not (CCompiler.compile() doesn't take
a target_lang argument but CCompiler.link() does). Is there a good
reason for this ?

No idea, but I think the people who did module pcapy has a workaround in
their setup.py. No idea if the workaround is good or not (but it happens to
work for me).

http://oss.coresecurity.com/projects/pcapy.html

/Jorgen
 
G

George Sakkis

George Sakkis said:
I'm trying to build a C++ extension on Cygwin, but it fails because
distutils invokes gcc instead of g++. Looking into distutils internals,
it turns out that compilation is assumed to be independent of the
target language, while linking is not (CCompiler.compile() doesn't take
a target_lang argument but CCompiler.link() does). Is there a good
reason for this ?

Is this a coincidence or what ? A patch for exactly this issue was
posted just five days ago (http://python.org/sf/1222585), so it should
be fixed in 2.5.

George
 

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