How to set up Visual Studio for GDNative environment?

Godot Version

4.2.2

Question

Hi,

I followed this guide to set up a C++ environment for godot: GDNative C++ example — Godot Engine (3.5) documentation in English

My structure is the following:
— godot-cpp /
— src (For the native sources
— [the game project source folder]
— SConstruct

With Visual Studio 2022 I tried to set up a project. I added the .h and .cpp files as source from /src folder.
Then, I added the godot-cpp include folders and lib files as on the following screenshots:


My problem is that in VS I get a lot of ambigous errors, for exampel for “using namespace godot;” I get that godot is ambigous, same for Ref and lots of keywords from godot-cpp. What am I missing from the VS setup?

With Scons, my native scripts build well and they work in my Godot editor/Game.

Thank you!

1 Like

Bummer. :frowning:
Did not allow to edit, but to further clarify:
src is my custom native sources folder, godot-cpp folder is for the latest godot-cpp repository submodule as in the tutorial. The VS project files are also in the main folder, alongside these folders and files.