Open kburchfiel opened 2 years ago
@Chaosus wrong topic added, its v.3.4 so gdnative instead of gdextension
@kburchfiel It compiles fine for me on VS2019. Seems to be an issue with VS2022.
In godot-cpp I ran: scons target=release platform=windows generate_bindings=yes
In root folder I ran: scons target=release platform=windows
An important note here in the error you posted "library machine type 'x64' conflicts with target machine type 'x86'" says that your machine needs to be x64 bits. Perhaps that maybe the issue.
wrong topic added, its v.3.4 so gdnative instead of gdextension
There is no gdnative label anymore, and gdextension is replacement
SConstruct from GDNative example does not support 32-bits. Visual Studio 2022 should be fine (at least on my end).
Thanks for the quick responses. I do have a 64-bit machine, so I'm wondering what might be causing it to try to compile within 32 bits. I think I added bits=64 as a parameter but still retrieved an error (but I can retry this). Is there another way to force 64-bit compilation?
Also, I had already run scons target=release platform=windows generate_bindings=yes within godot-cpp before uploading the folder. Is it necessary to rerun this before running scons in the root folder?
One way to get the x64 bits is to run the commands in a x64 Native Tools command prompt from Visual Studio. There should be shortcuts created when you installed Visual Studio.
@3ddelano That solved it, thank you! I was able to compile the plugin successfully by using x64 Native Tools Command Prompt for VS 2022 instead of Developer Command Prompt for VS 2022.
Godot version
3.4
System information
Windows 10
Issue description
I am going through the GDNative C++ example and am currently on the 'Compiling the plugin' step. I'm using Visual Studio 2022 and versions 3.4 of godot-headers and godot-cpp.
When I try to compile the sample plugin with scons platform=windows, I receive the following set of error messages:
I'm not sure whether I need to update the Sconstruct file, the gdexample.cpp/gdexample.h/gdlibrary.cpp files, or something else. Thank you in advance for your help!
Steps to reproduce
I believe I've followed the steps in the GDNative C++ tutorial accurately so far. Perhaps my use of Visual Studio 2022 (as opposed to an earlier version) is contributing to this issue.
Minimal reproduction project
The .zip version of my folder was too large to upload here, so I uploaded a copy to Google Drive instead:
https://drive.google.com/file/d/1wFYuPgbiIuqVddUoefdQJFFJVMYlu03W/view?usp=sharing