我们正在尝试为我们的游戏引擎构建编辑器,因此我们在编辑器Proj中的引擎和链接中创建了一个库。 在Proj中注释了Lib和Include Dir的路径。支柱。 我尝试过,没有WinAPI,但链接错误仍然存在。 直接在Header工作中定义的函数,但在C++文件中定义的函数正在创建链接错误。我必须在Proj中添加.cpp文件,是不是完全是这样的库? -.-自制Lib的链接错误
操作系统:Windows 7 64位
Visual Studio 2010中
#include "pch.h"
Application* g_pApp = NULL;
INT WINAPI WinMain(__in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nShowCmd)
{
BlocoApp blocoApp(&g_pApp);
// start engine
Editor mainForm;
if(!g_pApp->Init(L"Bloco", 1600, 900, true, hInstance))
{
g_pApp->Exit();
return 1;
}
// main loop
DXUTMainLoop();
g_pApp->Exit();
return 0;
}
的编译器错误:
error LNK2001: Nicht aufgelöstes externes Symbol ""public: bool __thiscall Application::Init(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> >,unsigned int,unsigned int,bool,struct HINSTANCE__ *,struct HWND__ *)" ([email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z)".
也许你可以分享一些代码?此外链接器给你的具体错误信息。 – Attila 2012-03-23 21:10:24
请发布实际错误(复制粘贴)。有问题的功能(和呼叫站点)的来源可能会有所帮助。我很惊讶这种事情需要多少次被要求。 – 2012-03-23 21:13:19
抱歉,忘了源代码^^ – 2012-03-23 21:19:59