Question about Visual Studio Community configuration

156 views
Skip to first unread message

Lorenzo Portillo

unread,
Jun 19, 2022, 5:26:54 AM6/19/22
to emscripten-discuss
Hello. I'm new in WebAssembly. I'm trying to use Visual Studio Community to create a project, but I'm having a hell to configure the IDE to work with emscripten. I created a CMake project, I think that's the best option, but I get many errors in IDE.

Any idea of what's the best way to create a C++ project focused to emscripten in VS?

Screenshot_2.png

Lorenzo Portillo

unread,
Jun 19, 2022, 1:44:09 PM6/19/22
to emscripten-discuss
All errors in VS come from that __atribute__ label. Is there a way to compile a project in Visual Studio CMake project having emscripten as dependency?

Screenshot_3.png

Floh

unread,
Jun 21, 2022, 5:38:33 AM6/21/22
to emscripten-discuss
This looks to me like the MSVC compiler is used for compilation, not the Emscripten compiler wrapper (emcc)

Are you aware of the emcmake wrapper tool, and the cmake toolchain file in the Emscripten SDK? Those can help with building cmake projects in Emscripten, however I doubt that those would simply work with the cmake Visual Studio generator (but maybe it works with the Ninja generator and Visual Studio's new-ish direct cmake support which, instead of Visual Studio solution files).

TL;DR: Visual Studio support might work with some tinkering, but I think it's not a "supported scenario".

This might actually be a more sensible combination to get started:

- use the emcmake wrapper to generate Ninja files
- use VSCode with the CMake Tools extension instead of VStudio (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)

Lorenzo Portillo

unread,
Jun 21, 2022, 12:12:47 PM6/21/22
to emscripten-discuss
Thanks for the answer.

Yes, you are right, the problem here is the compiler.
Today I will try to use Clang compiler with CMake, I hope that will work. It has support within Visual Studio.
I'll update about this.

Reply all
Reply to author
Forward
0 new messages