473,386 Members | 1,702 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,386 software developers and data experts.

Can't embed python in C++(Mingw[3.*] compiler)

For thr program,
#include "E:\Python25\include\Python.h"
#include<iostream>

int main(int argc, char* argv[]){
Py_Initialise();
Py_Finalise();
return 0;
}
I get the errors,
main.cpp:7: `Py_Initialise' undeclared (first use this function)
main.cpp:7: (Each undeclared identifier is reported only once for each
function
it appears in.)
main.cpp:8: `Py_Finalise' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 1 seconds)
I included "E:\Python25\include\Python.h"

Also I think that when I use C instead of c++ errors did'nt happen
although I can't repeat that now
Also do I need to link only 'libpython25.a'

May 19 '07 #1
4 1766
En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan
<ar************@rediffmail.comescribió:
For thr program,
#include "E:\Python25\include\Python.h"
#include<iostream>
Configure your environment so using:

#include <Python.h>

works (you may need to add E:\Python25\include to some list of searched
directories, maybe an INCLUDE environment variable).

--
Gabriel Genellina

May 19 '07 #2
On May 20, 1:28 am, "Gabriel Genellina" <gagsl-...@yahoo.com.ar>
wrote:
En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan
<arjunajay_a...@rediffmail.comescribió:
For thr program,
#include "E:\Python25\include\Python.h"
#include<iostream>

Configure your environment so using:

#include <Python.h>

works (you may need to add E:\Python25\include to some list of searched
directories, maybe an INCLUDE environment variable).

--
Gabriel Genellina
That AND I didn't use the american spelling Py_Initiali >>Z <<< e();

May 20 '07 #3
Arjun Narayanan wrote:
That AND I didn't use the american spelling Py_Initiali >>Z <<< e();
Like many words ending in -ize/-ise, initialize is listed with what you
call the "American" spelling in the Oxford English Dictionary.
--
Michael Hoffman
May 20 '07 #4
On May 19, 6:14 pm, Arjun Narayanan <arjunajay_a...@rediffmail.com>
wrote:
For thr program,
#include "E:\Python25\include\Python.h"
Consider using

#include "E:/Python25/include/Python.h"

or

#include "E:\\Python25\\include\\Python.h"

instead.

Or use

#include <Python.h>

and compile with

-IE:/Python25/include



May 20 '07 #5

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

Similar topics

0
by: Andrew Gregory | last post by:
In Python 2.2, I compiled some C++ code on Windows (MinGW compiler) to create an extension using distutils and the following setup.py file: from distutils.core import setup, Extension setup...
0
by: Phil Schmidt | last post by:
I'm attempting to follow the instructions at http://sebsauvage.net/python/mingw.html, without luck. I have Python 2.3, MinGW 3.2.3, ans SWIG 1.3.19. I get an export error on "initexample" when...
3
by: dbrown2 | last post by:
I'm trying to understand and document how to install pypar on Win2k. Pypar needs to be installed with some MPI library code and also needs libpython23.a and other files which are not included with...
2
by: C. Barnes | last post by:
Normally, one uses the following procedure to build and install a C/C++ extension: python setup.py build --compiler=your_compiler python setup.py install For Python 2.3.3 on Windows, with...
10
by: Kotlin Sam | last post by:
For a while at least I have to work in Windows rather than UNIX, which is more familiar. I'm trying to do with Python some of the things that I've done for years in shell, in particular, sort. The...
66
by: Srijit Kumar Bhadra | last post by:
Is there any specific reason for not using MinGW to build the official distribution of Python for Win32? A quick Google search did not reveal the answer to my question. If a link is available,...
15
by: Brian Blais | last post by:
Hello, Are there any recommendations for which Windows python version to use? I'd like to see a pros-and-cons description of each, given that different uses might dictate different versions. ...
22
by: mattf | last post by:
I've discovered Python and have been trying it out lately as a possible replacement for computations that would ordinarily be done with a commercial package like Matlab or IDL. I'd like to mention...
15
by: kyosohma | last post by:
Hi, I am trying to get a small group of volunteers together to create Windows binaries for any Python extension developer that needs them, much like the package/extension builders who volunteer...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.