LNK2019 Error

Started by
1 comment, last by fathom88 14 years, 11 months ago
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?
Advertisement
I'm a little rusty on this, but I believe you need the extern "C" on the import as well to avoid name mangling.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

You are right. The dll was successfully used on other development platforms. It had not been tested w/ the Visual Studio. Thanks.

This topic is closed to new replies.

Advertisement