# Using CMake to build Visual Studio-based C++ projects(and MSVC toolchain) for ARM64EC fails with linker error

**URL:** https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413
**Category:** Development
**Tags:** os:windows
**Created:** [January 16, 2025, 7:41pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413 "2025-01-16T19:41:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![numbers1123](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@numbers1123](https://discourse.cmake.org/u/numbers1123)
#### Post date: [January 16, 2025, 7:41pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413/1 "2025-01-16T19:41:51Z")

</div>

Hello all,

I believe the following commit has regressed the building of C++ binaries using Visual Studio and the MSVC toolchain for ARM64EC specifically. We receive a linker error that relates to the additional vftable exports that now get added to the DEF file; the error is a result of said entries not containing the DATA keyword.

[Merge topic ‘AutoExport-vftable’ · Kitware/CMake@b297b63](https://github.com/Kitware/CMake/commit/b297b63f17e6c4f7c24fa14521519179a18b6e35)

I am thinking that perhaps the vftable symbols should be added to the DataSymbols container instead of Symbols, where I suspect they would organically get the required DATA keyword.

Wanting to vet this on the forum before filing an issue.

Thank you!

Ron

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [January 16, 2025, 7:54pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413/2 "2025-01-16T19:54:12Z")

</div>

That commit added a data symbol to the exports and revealed that `WINDOWS_EXPORT_ALL_SYMBOLS` needs implementation updates to handle data symbols for tools targeting ARM64EC. See [CMake Issue 26604](https://gitlab.kitware.com/cmake/cmake/-/issues/26604).

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [January 16, 2025, 8:00pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413/3 "2025-01-16T20:00:22Z")

</div>

> [@numbers1123](#):
>
> perhaps the vftable symbols should be added to the DataSymbols container instead of Symbols

Yes, thanks. I’d welcome a merge request for that. See [CONTRIBUTING.rst](https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst).

---

<div class="post-metadata">

### Author: ![numbers1123](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/n/3ab097/32.png) [@numbers1123](https://discourse.cmake.org/u/numbers1123)
#### Post date: [January 16, 2025, 8:04pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413/4 "2025-01-16T20:04:49Z")

</div>

Thanks Brad. I am working with the op that reported the issue to us at Microsoft. It looks like the issue now understood per the latest on [https://gitlab.kitware.com/cmake/cmake/-/issues/26604](https://gitlab.kitware.com/cmake/cmake/-/issues/26604).

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [January 16, 2025, 8:26pm UTC](https://discourse.cmake.org/t/using-cmake-to-build-visual-studio-based-c-projects-and-msvc-toolchain-for-arm64ec-fails-with-linker-error/13413/5 "2025-01-16T20:26:14Z")

</div>

Thanks for pointing out that we already support `DATA` symbols. I’ve opened [CMake MR 10187](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10187) to fix this.
