这是我的简单设置:(我隐藏了很多不需要的信息)
//AutoFocusTest.h
#include "camAVTEx.h"
class CAutoFocusTestApp : public CWinApp
{
protected:
camera_t* mCamera;
public:
virtual BOOL InitInstance();
};
//camAVTEx.h
class camera_avtcam_ex_t : public camera_t
{
public:
camera_avtcam_ex_t();
virtual ~camera_avtcam_ex_t();
//member variables
//member function declarations
}
//camAVTEx.cpp
#include "camAVTEx.h"
camera_avtcam_ex_t::camera_avtcam_ex_t()
{
//stuff
}
camera_avtcam_ex_t::~camera_avtcam_ex_t()
{
//stuff
}
//the rest are defined here in my program
//AutoFocusTest.cpp
#include AutoFocusTest.h
BOOL CAutoFocusTestApp::InitInstance()
{
mCamera = new camera_avtcam_ex_t();
}
此设置会产生错误:
3>AutoFocusTest.obj : 错误 LNK2001: 无法解析的外部符号 "public: __cdecl camera_avtcam_ex_t::camera_avtcam_ex_t(void)" (??0camera_avtcam_ex_t@@QEAA@XZ)
从我读到的关于这个相对常见的问题的所有内容中,我没有链接导致我的 camera_avtcam_ex_t 函数定义找不到的东西。但是,我无法弄清楚我可能错过了什么。我已添加所有包含目录和库目录,并将库文件添加到附加依赖项部分。
谁能发现我可能遗漏的任何东西?