Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TinyEXR module cross-build fails on macOS (mingw-w64) #14007

Closed
bruvzg opened this issue Dec 5, 2017 · 4 comments
Closed

TinyEXR module cross-build fails on macOS (mingw-w64) #14007

bruvzg opened this issue Dec 5, 2017 · 4 comments

Comments

@bruvzg
Copy link
Member

bruvzg commented Dec 5, 2017

Operating system or device, Godot version, GPU Model and driver (if graphics related):

macOS 10.13.1; mingw-w64 5.0.3 (macports); gcc 7.2.0; Godot 3.0 (9a96a2a)

Build command: scons -j8 p=windows tools=yes bits=64 target=debug

Probably macOS specific, I didn't encountered this problem on Linux or MSYS2.

Issue description:
Multiple occurrences of fopen_s was not declared in this scope errors:

In file included from thirdparty/tinyexr/tinyexr.cc:2:0:
thirdparty/tinyexr/tinyexr.h: In function <<int LoadEXRImageFromFile(EXRImage*, const EXRHeader*, const char*, const char**)>>:
thirdparty/tinyexr/tinyexr.h:10838:3: error: <<fopen_s>> was not declared in this scope
   fopen_s(&fp, filename, "rb");
   ^~~~~~~
...

Steps to reproduce:
Compile Godot with mingw-w64 on macOS.

Edit:
Same happens with updated TinyEXR from #14006

@akien-mga
Copy link
Member

There was the same issue on Linux with mingw-w64 3.x, but it's been fixed since 4.x. So I wonder why it's triggered for you with mingw-w64 5.0.3.

We can extend the logic of this hack (37f5e1d) so that it builds with macports' mingw-w64, but I'd suggest to also make a bug report upstream about that as it seems to be a bug if it works fine on Windows and Linux but not on macOS.

@bruvzg
Copy link
Member Author

bruvzg commented Dec 6, 2017

Problem can be fixed by building with CCFLAGS=-DMINGW_HAS_SECURE_API, look like macports mingw-w64 is configured without --enable-secure-api flag.

@godotengine godotengine deleted a comment from drentsoft Dec 6, 2017
@akien-mga
Copy link
Member

I guess you should open a ticket with macports to see if they'd consider enabling this flag? If not and for a valid reason, tinyexr should be patched to take it into account (ideally upstream).

@akien-mga akien-mga removed this from the 3.0 milestone Dec 11, 2017
@bruvzg
Copy link
Member Author

bruvzg commented Dec 11, 2017

macports accepted change: macports/macports-ports@6196ddb, closing.

@bruvzg bruvzg closed this as completed Dec 11, 2017
@akien-mga akien-mga added this to the 3.0 milestone Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants