LNK2019 Error
VC++ 7.0
I'm trying to use a dll provided by someone else. I have the header, lib, and dll files. I included the .h in my app's .cpp. Under linker->input->additional dependencies, I included the name of the lib. Under linker->general->additional lib dir, I added the path of the dll. When I compile, I get
FlightXY error LNK2019: unresolved external symbol "__declspec(dllimport) long __cdecl InitPhyX(void)" (__imp_?InitPhyX@@YAJXZ) referenced in function "protected: void __thiscall CFlightXYDlg::OnPaint(void)" (?OnPaint@CFlightXYDlg@@IAEXXZ)
The top of the header has this directive.
#ifdef PHYX_EXPORTS
#define PHYX_API_FUNC extern "C" __declspec(dllexport)
#else
#define PHYX_API_FUNC __declspec(dllimport)
#endif
What am I missing?
I'm a little rusty on this, but I believe you need the extern "C" on the import as well to avoid name mangling.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement