So, I'm writing my own static library, and so far it was working well. I'm trying to implement Python in C++. To make it easier on myself, I put the calls to Python into their own function, Py_Arg:
#include "exampleApp.h"
std::string test()
{
char* paras[] = {"123", "345"};
Py_Arg("test", "multiply", (char*)paras);
return "";
}
int Py_Arg(char* fileName[], char* funcName[], char* argv[])
{
}
And, in my header file "exampleApp.h"...
#include <string>
#include <string.h>
#include <iostream>
#include "Python/Includes/Python.h"
std::string test();
int Py_Arg(char*, char*, char*);
And, in my app to test the library...
#include "stdafx.h"
#include <exampleApp.h>
int main(int argc, char* argv[])
{
test();
std::system("PAUSE");
return 0;
}
Now, in VS I have imported the exampleApp.lib library the test project. I also, as you can see, specified the header location. However, when I try to run the program...
error LNK2001: unresolved external symbol "int __cdecl Py_Arg(char *,char *,char *)" (?Py_Arg@@YAHPAD00@Z)
When I remove the Py_Arg function completely from the library, it executes fine. But for some reason it can't see the Py_Arg function. Does this have to do with the char* arguments it takes? I'm kind of experimenting with the whole char*, char*[], const char[], etc right now and I'm very lost. Any help would be greatly appreciated.
Thanks in advance.