Статическое связывание MFC Неразрешенный внешний символ

Я пытаюсь создать собственную версию GyazoWin, используя Use of MFC:Use MFC in a Static Library, и это приводит к огромному списку ошибок ссылок.

Как я могу успокоить 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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.obj gyazowin
Error   17  error LNK2019: unresolved external symbol __imp__ShellExecuteExW@4 referenced in function "void __cdecl execUrl(char const *)" (?execUrl@@YAXPBD@Z) S:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.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:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\gyazowin\gyazowin.obj gyazowin
Error   19  error LNK1120: 17 unresolved externals  S:\Software\Microsoft\Visual Studio\Projects\Completed (New)\gyazowin\Debug\gyazowin.exe    gyazowin

1

Решение

Для функциональности из библиотек платформы:

  1. Выполните поиск по названию функции (например, «GetStockObject»), используя вашу любимую поисковую систему.

  2. Найдите документацию для функции в MSDN (например, GetStockObject). Обычно это один из лучших результатов.

  3. В документации в разделе «Требования» найдите запись «Библиотека». Это библиотека, с которой вы должны связаться, чтобы использовать функцию (для GetStockObjectэто gdi32.lib).

  4. Повторяйте, пока не устраните все ошибки.

5

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]