MFC 静态链接未解析的外部符号
MFC Static Linking Unresolved External Symbol
我正在尝试使用Use of MFC:
Use MFC in a Static Library
构建GyazoWin的自定义版本,这导致了大量的引用错误。
如何安抚Visual Studio,以便我可以使用静态链接库进行构建?
更新
我设法将 user32 添加到链接库中(我认为),现在我只有 1/3 的错误量。谁能说出我现在错过了哪个图书馆?
Error 2 error LNK2019: unresolved external symbol __imp__BitBlt@36 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 3 error LNK2019: unresolved external symbol __imp__CreateCompatibleBitmap@12 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 4 error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 5 error LNK2019: unresolved external symbol __imp__CreateFontW@56 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 6 error LNK2019: unresolved external symbol __imp__CreatePen@12 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 7 error LNK2019: unresolved external symbol __imp__CreateSolidBrush@4 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 8 error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 9 error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 10 error LNK2019: unresolved external symbol __imp__GetDeviceCaps@8 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 11 error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function "unsigned short __cdecl MyRegisterClass(struct HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 12 error LNK2019: unresolved external symbol __imp__Rectangle@20 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 13 error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 14 error LNK2019: unresolved external symbol __imp__SetBkMode@8 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 15 error LNK2019: unresolved external symbol __imp__SetTextColor@8 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 16 error LNK2019: unresolved external symbol __imp__TextOutW@20 referenced in function "long __stdcall LayerWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?LayerWndProc@@YGJPAUHWND__@@IIJ@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 17 error LNK2019: unresolved external symbol __imp__ShellExecuteExW@4 referenced in function "void __cdecl execUrl(char const *)" (?execUrl@@YAXPBD@Z) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 18 error LNK2019: unresolved external symbol __imp__SHGetSpecialFolderPathW@16 referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl getId(void)" (?getId@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowingyazowingyazowin.obj gyazowin
Error 19 error LNK1120: 17 unresolved externals S:SoftwareMicrosoftVisual StudioProjectsCompleted (New)gyazowinDebuggyazowin.exe gyazowin
对于平台库中的功能:
-
使用您喜欢的搜索引擎搜索函数的名称(例如"GetStockObject")。
-
在 MSDN 上查找该函数的文档(例如 GetStockObject)。 这通常是最重要的结果之一。
-
在文档中的"要求"下,找到"库"条目。 这是您必须链接才能使用该函数的库(对于
GetStockObject
,它是 gdi32.lib)。 -
重复此操作,直到解决完所有错误。
相关文章:
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- 未解析的外部符号_MsiLocateComponentW@12.
- 在C++中使用 gRPC 时未解析的外部符号
- LibPrivoxy: 未解析的外部符号 __declspec(dllimport) int __stdcall Sta
- 尝试从 XamlApplication 编译 C++/WinRT 空白应用程序时,我收到未解析的外部符号 winrt_make_*
- 我收到错误LNK2001:未解析的外部符号(C++代码)
- 可视抽象类 c++(错误 LNK 2001:未解析的外部符号)
- 如何摆脱C++中未解析的外部符号"private: static char"错误?
- 当 lib 已添加到其他依赖项时,如何在 VS 中调试未解析的外部符号错误
- 仅在少数方法(静态或共享库)中解析的外部符号
- 未解析的外部符号"__declspec(dllimport)与 Spdlog c++ 库
- 函数 _main (OPENGL C++) 中引用的未解析的外部符号 ________
- 错误LNK2019未解析的外部符号"public: __thiscall SLinkList<char>::SLinkList<char>(void)"
- 使用静态 constexpr 成员的未解析外部符号
- 引入参数化构造函数后显示 LNK 2019 未解析外部符号的代码错误
- Dlib LNK2001未解析的外部符号USER_ERROR__consistent_build_configurati
- 矛盾的未解决的外部符号+未使用的库与VS2017和FFMPEG 4
- 链接器错误:切换到unicode生成给出:未解析的外部符号WinMain
- 类模板上一个特定函数的未解析外部符号
- LNK2001:未解析的外部符号public:static类std::vector