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

A

Arjun Narayanan

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'
 
G

Gabriel Genellina

En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan
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).
 
A

Arjun Narayanan

En Sat, 19 May 2007 13:14:40 -0300, Arjun Narayanan


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).

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

Michael Hoffman

Arjun said:
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.
 
S

sturlamolden

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
 

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,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top