By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.