これはなぜ起こっているのですか?私は、Microsoft(R)インクリメンタルリンカバージョン14.00.24215.1でコンパイルすると、「CL/EHscのwinbasicb.cpp」のコマンドライン入力のためのコマンドラインで「/ EHsc」オプションを使用して使用していますWINDOWS apiが外部シンボルを解決できない
#define _x64
#include<Windows.h>
#include<iostream>
#include<windef.h>
#include<Winuser.h>
#include<tchar.h>
using namespace std;
int WINAPI MessageBoxW(
_In_opt_ HWND hWnd,
_In_opt_ LPCTSTR lpText,
_In_opt_ LPCTSTR lpCaption,
_In_ UINT uType
);
int main(){
cout << MessageBoxW(NULL,L"",L"",0);
}
。私は気持ちがいいとは思わない。最適化されたコンパイルとリンクのために/ EHscオプションを使用するだけです。
このエラーが発生しています。
/out:winbasicb.exe
winbasicb.obj
winbasicb.obj : error LNK2019: unresolved external symbol __imp_MessageBoxW referenced in function main
winbasicb.exe : fatal error LNK1120: 1 unresolved externals
'L" ... "は、ユニコード文字列を表します。 –