Godot: Cannot build Windows export template from MacOS

Created on 10 Oct 2019  路  4Comments  路  Source: godotengine/godot

Godot version: Master Branch, Commit 781e4f8673857b2b318e919ecb780bfad972a5a6

OS/device including version: MacOS Mojave 10.14.6. Macbook Pro 15" 2018.

Issue description: I can build for MacOS normally. However, when I try to build an export template for Windows, there are some function calls that are not recognised. Searching the internet for the solution, some people argued that sprintf_s and wcspy_s are not functions from the standard C++ Library. Maybe other functions should be used instead.

Steps to reproduce: Install everything you need to compile Godot from source (i.e. Python, scons, etc). Additionally, I installed mingw with brew, as recommended by the docs (brew install mingw).

Minimal reproduction project: I do not have a project to share, as I'm simply trying to build Godot itself for Windows from a Mac machine.

Screen Shot 2019-10-09 at 15 38 39
Screen Shot 2019-10-09 at 15 38 48
Screen Shot 2019-10-09 at 15 43 09
Screen Shot 2019-10-09 at 15 47 51

archived bug buildsystem

Most helpful comment

@rafaelgdp I opened a pull request on the documentation repository, see above :slightly_smiling_face:

All 4 comments

Try adding CXXFLAGS="-DMINGW_HAS_SECURE_API" to the scons command, it's missing from the default configuration of some MinGW distribution.

Try adding CXXFLAGS="-DMINGW_HAS_SECURE_API" to the scons command, it's missing from the default configuration of some MinGW distribution.

Adding this flag actually solved my problem!! I have no idea what it stands for, but it made the build work! Thank you so much! By the way, I wonder if this notice should be present in the official documentation. It was really frustrating not being able to compile the engine because of silly "undefined-token" errors.

@rafaelgdp I opened a pull request on the documentation repository, see above :slightly_smiling_face:

This is just for posterity who ran into this issue,

As per https://github.com/godotengine/godot/issues/33062,
We embeded -DMINGW_HAS_SECURE_API=1 into the build script,
which means that people don't need to specify this flag manually.
We expect people not to see this error anymore on the latest 3.1 and master.

Was this page helpful?
0 / 5 - 0 ratings