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.




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.
Most helpful comment
@rafaelgdp I opened a pull request on the documentation repository, see above :slightly_smiling_face: