[Tutor] Need Help Embedding Python in C++

Jmllr891@cs.com Jmllr891@cs.com
Wed, 25 Sep 2002 21:16:29 EDT


--part1_d8.1e16ea25.2ac3b9ed_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Hi, I am having trouble embedding Python in C++. I am using the DJGPP 
compiler and Python 2.2.1. I am using extremely basic code just to try and 
see if I can successfully embed Python in my program without errors.

This is my "test code":

------------------------------------------------------------------------------

----------

#include <Python.h>     
                
int main()          
{               
  return 0;         
}               

------------------------------------------------------------------------------

----------

This produces the following errors when I try to compile:

------------------------------------------------------------------------------

----------

Compiling: c:/windows/desktop/test.cpp                          
                                                
d:/djgpp/include/python.h(62) In file included from 
d:/djgpp/include/python.h62,        
../desktop/test.cpp(6)                                  
                                            
d:/djgpp/include/pyport.h(480) Error: #error "LONG_BIT definition appears 
wrong for platform (bad gcc/glibc config?).                             
                                            
There were some errors.

------------------------------------------------------------------------------

----------  

I am running Windows ME (bleh, trying to switch to Linux) and I've never 
encountered any problems like this before with C/C++ or Python.

--part1_d8.1e16ea25.2ac3b9ed_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2 FAMILY="SANSSERIF" FACE="Arial" LANG="0">Hi, I am having trouble embedding Python in C++. I am using the DJGPP compiler and Python 2.2.1. I am using extremely basic code just to try and see if I can successfully embed Python in my program without errors.<BR>
<BR>
This is my "test code":<BR>
<BR>
----------------------------------------------------------------------------------------<BR>
<BR>
#include &lt;Python.h&gt;     <BR>
                <BR>
int main()          <BR>
{               <BR>
&nbsp; return 0;         <BR>
}               <BR>
<BR>
----------------------------------------------------------------------------------------<BR>
<BR>
This produces the following errors when I try to compile:<BR>
<BR>
----------------------------------------------------------------------------------------<BR>
<BR>
Compiling: c:/windows/desktop/test.cpp                          <BR>
                                                <BR>
d:/djgpp/include/python.h(62) In file included from d:/djgpp/include/python.h62,        <BR>
../desktop/test.cpp(6)                                  <BR>
                                            <BR>
d:/djgpp/include/pyport.h(480) Error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?).                             <BR>
                                            <BR>
There were some errors.<BR>
<BR>
----------------------------------------------------------------------------------------  <BR>
<BR>
I am running Windows ME (bleh, trying to switch to Linux) and I've never encountered any problems like this before with C/C++ or Python.</FONT></HTML>

--part1_d8.1e16ea25.2ac3b9ed_boundary--