I have write a program to run python script [python2.4] under CentOS with Qt4.7
class QPython
{
private:
public:
QPython(){}
{strScript = _strScript;}
~QPython(){}
int PythonInitialize()
{
Py_Initialize();
return Py_IsInitialized();
}
int process_expression(char* cScript)
{
return PyRun_SimpleString(cScript);
}
void PythonFinalize()
{Py_Finalize();}
};
class QPython
{
private:
QString strScript;
public:
QPython(){}
QPython(QString _strScript)
{strScript = _strScript;}
~QPython(){}
int PythonInitialize()
{
Py_Initialize();
return Py_IsInitialized();
}
int process_expression(char* cScript)
{
return PyRun_SimpleString(cScript);
}
void PythonFinalize()
{Py_Finalize();}
};
To copy to clipboard, switch view to plain text mode
i have an error
mainwindow.o: In function `QPython::PythonInitialize()':
/root/Desktop/PythonInterpreter/QPython.h:20: undefined reference to `Py_Initialize'
/root/Desktop/PythonInterpreter/QPython.h:21: undefined reference to `Py_IsInitialized'
mainwindow.o: In function `QPython:: process_expression(char*)':
/root/Desktop/PythonInterpreter/QPython.h:25: undefined reference to `PyRun_SimpleString'
mainwindow.o: In function `QPython::PythonFinalize()':
/root/Desktop/PythonInterpreter/QPython.h:28: undefined reference to `Py_Finalize'
collect2: ld returned 1 exit status
i need to solve it, i search with google and i don't find the solution for it, i see the solution for DevC++.
Thanks Hany
Bookmarks