Exporting functions with strings
-
Hi, I've got a (probably) common problem: I want to create a several unmanged C++ DLLs in VS2005, most of them shall export functions with strings (best CString), like this: void TestFunc1(int a, CString b); void TestFunc2(int a, LPCTSTR b); CString TestFunc3(int a); All these DLLs compile and link well, but when I try to use them in my applications, I always receive a linker error (LNK2019: undefined external symbol). Obviously, this problem is related to the use of strings as arguments (or return values), because if I remove them as arguments, everything works fine... any ideas how to solve this? Greetings, Peter
-
Hi, I've got a (probably) common problem: I want to create a several unmanged C++ DLLs in VS2005, most of them shall export functions with strings (best CString), like this: void TestFunc1(int a, CString b); void TestFunc2(int a, LPCTSTR b); CString TestFunc3(int a); All these DLLs compile and link well, but when I try to use them in my applications, I always receive a linker error (LNK2019: undefined external symbol). Obviously, this problem is related to the use of strings as arguments (or return values), because if I remove them as arguments, everything works fine... any ideas how to solve this? Greetings, Peter
Have you created an MFC or a regular dll? MFC dlls can only be used from MFC applications. If you want to use the functions from a not-MFC application, replace CString with string.