LNK2019未解决的外部declspec(dllimport)SDL_干管
我正在制作一个游戏引擎。引擎是dll项目。现在,引擎将构建到dll和库中。我正在尝试用另一个项目来测试我到目前为止的成果。以下是我收到的错误消息:LNK2019未解决的外部declspec(dllimport)SDL_干管,dll,import,export,lnk2019,Dll,Import,Export,Lnk2019,我正在制作一个游戏引擎。引擎是dll项目。现在,引擎将构建到dll和库中。我正在尝试用另一个项目来测试我到目前为止的成果。以下是我收到的错误消息: error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Aria::GameConfig::GameConfig(class std::basic_string<wchar_t,struct std::char_traits<w
error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Aria::GameConfig::GameConfig(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_??0GameConfig@Aria@@QAE@ABV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ) D:\My Documents\Programing\Repo\NDTD\NDTD\Project\Main.obj
error LNK2019: unresolved external symbol "public: __thiscall TestGame::TestGame(class Aria::GameConfig *)" (??0TestGame@@QAE@PAVGameConfig@Aria@@@Z) referenced in function "int __cdecl SDL_main(void)" (?SDL_main@@YAHXZ) D:\My Documents\Programing\Repo\NDTD\NDTD\Project\Main.obj
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup D:\My Documents\Programing\Repo\NDTD\NDTD\Project\MSVCRTD.lib(crtexe.obj)
在中,我使用预处理器定义ARIA\u NONCLIENT\u BUILD
和UNICODE
以及它定义的窗口构建了引擎。我已经链接到SDL库并包含了头文件。我还在wchar中使用unicode字符串。我还没有忘记在类定义中添加ARIA_API宏
在测试项目中,这里是main.cpp文件
#include <Game\Game.h>
using namespace Aria;
class TestGame : public IGame
{
public:
TestGame(GameConfig* config);
~TestGame();
void OnStartUp() override;
void OnUpdate(float dt) override;
void OnRender(float dt) override;
void OnShutdown() override;
};
void TestGame::OnStartUp()
{
}
void TestGame::OnUpdate(float dt)
{
}
void TestGame::OnRender(float dt)
{
}
void TestGame::OnShutdown()
{
}
int main()
{
GameConfig* config = new GameConfig(ATEXT("test.config"));
TestGame* game = new TestGame(config);
return game->Run();
}
#包括
使用名称空间Aria;
类TestGame:公共IGame
{
公众:
TestGame(GameConfig*config);
~TestGame();
void OnStartUp()覆盖;
无效更新(浮动dt)覆盖;
void OnRender(float dt)覆盖;
void OnShutdown()覆盖;
};
void TestGame::OnStartUp()
{
}
void TestGame::OnUpdate(float dt)
{
}
void TestGame::OnRender(float dt)
{
}
void TestGame::OnShutdown()
{
}
int main()
{
GameConfig*config=newgameconfig(ATEXT(“test.config”);
TestGame*game=新的TestGame(配置);
返回游戏->运行();
}
如果我忘了什么,请告诉我。您是否看到问题右侧的所有“相关”项?答案几乎肯定就在那里。我已经尝试过c++->language->wchar\t作为内置工具,更改visual studio版本,但到目前为止,这些技巧都没有奏效
#include <Game\Game.h>
using namespace Aria;
class TestGame : public IGame
{
public:
TestGame(GameConfig* config);
~TestGame();
void OnStartUp() override;
void OnUpdate(float dt) override;
void OnRender(float dt) override;
void OnShutdown() override;
};
void TestGame::OnStartUp()
{
}
void TestGame::OnUpdate(float dt)
{
}
void TestGame::OnRender(float dt)
{
}
void TestGame::OnShutdown()
{
}
int main()
{
GameConfig* config = new GameConfig(ATEXT("test.config"));
TestGame* game = new TestGame(config);
return game->Run();
}