This is probably a duplicate, but there are so many LNK2019
questions, I can't read them all. Here's my problem: I'm getting the following error message:
4>ScatterometerView.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall CPGLGraphBitDlgBSDF::CPGLGraphBitDlgBSDF(class CPGLGraph *)" (__imp_??0CPGLGraphBitDlgBSDF@@QAE@PAVCPGLGraph@@@Z)
referenced in function "public: void __thiscall CScatterometerView::DisplayBSDFPlot(class BSDF *)" (?DisplayBSDFPlot@CScatterometerView@@QAEXPAVBSDF@@@Z)
When I look at the output of DUMPBIN
, I see my constructor:
12 B 00002EFF ??0CPGLGraphBitDlgBSDF@@QAE@PAVCPGLGraph@@@Z = @ILT+7930(??0CPGLGraphBitDlgBSDF@@QAE@PAVCPGLGraph@@@Z)
It has everything except the __imp__
. The class in the DLL is defined as follows:
#define PGL_EXT_CLASS _declspec(dllexport)
class PGL_EXT_CLASS CPGLGraphBitDlgBSDF : public CPGLGraphDlg
{
public:
static const int numPointsToAvg = 3;
CPGLGraphBitDlgBSDF();
CPGLGraphBitDlgBSDF(CPGLGraph* _pGraph);
~CPGLGraphBitDlgBSDF(void);
// ...lots more functions...
}
and the usage in the executable is:
CPGLGraph* pGraph = new CPGLGraph;
// ...code to fill in the graph data...
m_bsdf_plot = new CPGLGraphBitDlgBSDF(pGraph);
The kicker is that every other function in the class works; only the two I added recently (including this constructor) don't work. The older functions don't have the __imp__
decoration that seems to be required of my newly added functions.
The .def
files that were created define no functions, so this doesn't seem to be a difference. I used the MAP file
on the linker, and the only functions that have the __imp__
prefix are those defined by Microsoft. Not a single function defined in PGL.dll has it, and they all work fine. Please tell me where to look for the problem or even clues.