# Hello World with CMake
CMake ([cmake.exe](https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170) ) is a cross-platform, open-source tool for defining build processes that run on multiple platforms.
C++ CMake tools for Windows is installed with Visual Studio 2022 as part of the Desktop development with C++ and Linux Development with C++ workloads, which are required for cross-platform development.
The following example builds a simple Hello World project with CMake for Arm64 and Arm64EC.
Note that while these instructions are based on CMake 3.25.1, they have also been verified on CMake 3.29.3 (latest).
1. If not already installed, install CMake from GitHub:
1. Download [cmake-3.25.1-windows-x86_64.msi](https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-windows-x86_64.msi)  and save to `C:\Programs\cmake\` or location of choice.
2. Run `cmake-3.25.1-windows-x86_64.msi` to complete installation.
3. Add `C:\Programs\cmake\bin` to the Windows PATH environment.
2. Create a simple helloworld.cpp project in the `C:\Users\source\repos\HelloWorld\HelloWorld`` folder.
3. Add a `CMakeLists.txt` file with the following content:
project(helloworld)
cmake_minimum_required(VERSION 3.10)
add_executable(helloworld helloworld.cpp)
Copy to clipboard
4. Open a command prompt in the same location as `helloworld.cpp` and run the following commands to create a build directory in the same location as the `helloworld.cpp` source file:
C:\ ..\source\repos\helloworld\helloworld>mkdir build
C:\ ..\source\repos\helloworld\helloworld>cd build
Copy to clipboard
## Build for ARM64
1. The `-A ARM64` cmake parameter cross compiles the code to an Arm64 binary.
C:\ ..HelloWorld\build> cmake ../ -G "Visual Studio 17 2022" -A ARM64
Copy to clipboard
2. Use the `cmake --build
` command to build the application.
C:\ ..\source\repos\helloworld\helloworld\build> cmake --build ./ --config Release
Copy to clipboard
3. Find output at `build\Release\helloworld.exe`.
## Build for ARM64EC
1. The `-A ARM64EC` cmake parameter cross compiles the code to an Arm64EC binary.
C:\...HelloWorld\build> cmake ../ -G "Visual Studio 17 2022" -A ARM64EC
Copy to clipboard
2. Use the `cmake --build ` command to build the application.
C:\ ..\source\repos\helloworld\helloworld\build> cmake --build ./ --config Release
Copy to clipboard
## Build ARM64EC project that leverages x64 dependent libraries
The following steps explain how to link an x64 project with an ARM64 project to create a final project as ARM64EC.
First, create a Visual Studio project and add the Arm64EC release configurations using the following steps:
1. From the Visual Studio console, click **Launch**.
2. Select **Create a new project**.
3. Select **C++ Console App** and click **Next**.
>
>
> 
4. In the **Configure your new project** dialog, do the following:
>
>
> >
> >
> > 1. In **Project name**, enter `ARM64EC_Demo`.
> > 2. In **Location**, specify a location of choice.
> > 3. In **Solution name**, enter `ARM64EC_Demo`.
> > 4. Click **Create**.
>
>
>
> 
5. Add a release configuration for ARM64EC devices by following these [steps](https://docs.qualcomm.com/bundle/publicresource/topics/80-62010-1/create-vs-project.html?#arm64ec-config).
6. Add the following code to the `ARM64EC_Demo.cpp` project you created in Step 4.
#include
extern void HelloWorld_x64();
int main()
{
std::cout << "Hello World!\\n";
// Call "Hello World" from the x64 project
HelloWorld_x64();
return 0;
}
Copy to clipboard
7. Create the x64 Project.
1. Right-click on **Solution ‘ARM64EC\_Demo’** then select **Add > New Project**.
>
>
> 
2. Create a static library project named `HelloWorld_x64`.
>
>
> 
3. Add the following code to `HelloWorld_x64.cpp`.
#include "pch.h"
#include "framework.h"
#include
extern void HelloWorld_x64()
{
std::cout << "Hello World from X64...\\n";
}
Copy to clipboard
8. Right-click on the `ARM64EC_Demo` project in Solution Explorer and select **Properties**. Go to **Configuration Properties** -> **VC++ Directories**.
1. Add the path to the `HelloWorld_x64` project library in the Library Directories.
2. Go to Configuration Properties -> Linker -> Input.
3. Add the `HelloWorld_x64.lib` in the Additional Dependencies.
9. Build the `HelloWorld_x64` project first to generate `HelloWorld_x64.lib`.
10. Build the `ARM64EC_Demo` project.
To verify if the `ARM64EC_Demo` project is ARM64EC and dependent `HelloWorld_x64` project is x64, right-click on Solution Explorer and select **Properties**. Go to **Configuration Properties**

Use the following steps to identify ARM64EC binaries for project `ARM64EC_Demo`:
1. Open Developer Command Prompt for VS 2022.
2. Change to directory where `ARM64EC_Demo.exe` is available.
3. Run: `link /dump /headers ARM64EC_Demo.exe`.
4. Verify ARM64EC binaries like below:

5. You can verify the architecture of `ARM64EC_Demo.exe` using Task Manager.
1. Add a breakpoint in your code and run the application through Visual Studio.
2. Check Task Manager for `ARM64EC_Demo.exe` details as shown below.

Note
C# code can be built to Arm64 but can’t be built to Arm64EC.
Last Published: Jun 16, 2026
[Previous Topic
Build](https://docs.qualcomm.com/bundle/publicresource/80-62010-1/topics/build.md) [Next Topic
Optimize](https://docs.qualcomm.com/bundle/publicresource/80-62010-1/topics/optimize.md)