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

Arjun Narayanan arjunajay_ajay at rediffmail.com
Sat May 19 12:14:40 EDT 2007


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'




More information about the Python-list mailing list