윈도우 Arm 콘솔에서 C++ 컴파일

IOVEIT·2023년 9월 19일
0

Windows Arm64를 사용하다보니 불편한 게 이만 저만이 아니다. 예컨대 NMAP은 Arm Native앱이 존재하지 않아 x86 가상 환경으로 설치된다. 그러나 제대로 실행되지 않는다. 여하튼 Visual Studio Arm을 설치한 기념으로, 윈도우 Arm 콘솔에서 cpp파일 컴파일해보자. 별거 없다. Arm에서도 C++ 컴파일이 잘 된다.

1. 시작 - 검색에서 "ARM64_x64 Cross Tools Command Prompt for VS 2022"를 찾아서 실행한다. 여기선 환경설정 없이 cl 치면 컴파일러가 실행된다.

2. hello.cpp 코드를 작성한다.

#include <iostream>
using namespace std;
int main()
{
    cout << "Hello, world, from Visual C++!" << endl;
}

3. 코드를 컴파일한다.

c:\code>cl /EHsc hello.cpp

|참고|
https://learn.microsoft.com/ko-kr/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line?view=msvc-170

profile
EnCoCookLand

0개의 댓글

관련 채용 정보