472,351 Members | 1,613 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

PROBLEM: compiling C programs that link to Python

Hi all.

I'm not subscribed to the list, so all replies to me mail directly.

I ran into a small problem, for which we have found a workaround. I was compiling PostgreSQL v7.4.1 and it's PL/Python module. Compilation failed on lines which had this:

typedef struct PLyPlanObject {
PyObject_HEAD;
...
} PLyPlanObject;

The problem was in that semicolon following "PyObject_HEAD", since that is a CPP define which expands to this:

typedef struct PLyPlanObject {
int ob_refcnt ; struct _typeobject * ob_type ; ;
...
} PLyPlanObject;

That extra ";" breaks compiling on strict ANSI-C compilers (or at least on mine - DEC CC on Tru64 UNIX). The workaround was to remove the ";" from plpython.c source file. It could be that GNU C is not complaining on this, since it is more lenient on C irregularities.

The idea I'd like to float here is that you guys remove the trailing ";" from your "#define ...". The source looks much more natural with a semicolon at the end.

I know that this idea is going to create resistance, "it is working for us", "it is working on GCC", "it will create other changes in existing source base", "you've solved your problem". The only argument in my favour I can give is that, well, C standard doesn't recognize "; ;" in "structs". So, if you want to create CPP constructs like that "#define", create them so they can be used without breaking the standards.

TYIA,
Nix.
Jul 18 '05 #1
0 1286

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

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and...
3
by: Zdenda | last post by:
Hi, i have RH9 and i need python 2.3. I executed tgz file and typed ./configue. Then i type make. It is without problem. When I type make install...
2
by: Dimi Shahbaz | last post by:
Hi, I've seen a few tools to create standalone executables from python scripts (py2exe, cx Freeze). My question is, has anyone created a tool to...
6
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME...
6
by: Club-B42 | last post by:
i've compiled my programm using command "python setup.py py2exe >1" python script works fine, but .exe version fails with...
5
by: J | last post by:
Hi everyone, I started embedding python into a 3D graphics App and I came across this linking problem. SO.lib(ScnGlobal.obj) : error...
0
by: follower | last post by:
This post is mostly Google-bait for anyone else that might want to compile SpiderMonkey ( libjs / libjs.so / libjs.dylib ) for OS X (10.4.5 in my...
11
by: ZMY | last post by:
Dear all, I am a real newbie for both python and QNX, but I am still trying to compile Numeric-24.2 under QNX4.25 with python 2.2. I got...
4
by: vedrandekovic | last post by:
Hi, I have already install Microsoft visual studio .NET 2003 and MinGw, when I try to build a extension: python my_extension_setup.py build (...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

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.