0

好的,所以我有一个项目,我正在尝试为其创建一个包装器,这将允许我将它与 CLR 一起使用。

我已将我的 DirectX 项目编译为 .lib。当我尝试在我的 CLR 项目中链接它时,我收到以下错误:

1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxW@16 referenced in function __catch$?SetUpObjects@cMain@@AAE_NXZ$0
1>Renderer Library.lib(cGraphics.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxW@16
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__ShowCursor@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__SetFocus@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__SetForegroundWindow@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsW@8 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__GetSystemMetrics@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassExW@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "private: void __thiscall cMain::InitializeWindows(int &,int &)" (?InitializeWindows@cMain@@AAEXAAH0@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "private: void __thiscall cMain::ShutdownWindows(void)" (?ShutdownWindows@cMain@@AAEXXZ)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "private: void __thiscall cMain::ShutdownWindows(void)" (?ShutdownWindows@cMain@@AAEXXZ)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "public: long __stdcall cMain::MessageHandler(struct HWND__ *,unsigned int,unsigned int,long)" (?MessageHandler@cMain@@QAGJPAUHWND__@@IIJ@Z)
1>Renderer Library.lib(cMain.obj) : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)

我正在尝试创建一个用于渲染的窗口,但我必须调用的所有函数似乎都不起作用。

最终,我想重组我的 DirectX 项目,使我能够以我想要的 CLR 方式使用它。不过目前,我只是想让它玩得更好。问题似乎是我用来创建窗口和初始化我的 DirectX 设备的功能。不太确定如何补救它,无论是我错过了链接器还是我是否应该采用不同的策略。

4

0 回答 0