So, I have two projects: a library and a console app. In the library, I have the following function declaration:
std::string NewApp::Testing()
{
char* test[] = {"test", 0};
PyObject* obj = Python::Py_Arg("test", "test", test);
std::string s = PyString_AsString(obj);
return s;
}
Then, in the app, I call the function:
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << NewApp::Testing();
return 0;
}
Which all makes a call to the following Python script (which is in the same release directory as the static library):
def test(wrd):
return wrd
Yet, for whatever reason, I get the following error every time I run the program:
AttributeError: `module` object has no attribute `test`
Cannot find function "test"
And it's driving me crazy! It knows where the file is but it can't find the function. What could be causing it?? I've gotten embedded Python to work before in another app, yet I still can't get this one to work! Any help is appreciated. Thanks.