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

Fix msvc2019 winx64 compile issue #5

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

omrdk
Copy link
Contributor

@omrdk omrdk commented Jan 25, 2024

Such a great lightweight header file to get basic image information for 20 different formats. I'd also look for a chance to get *.exr information but still good enough to get by. Tested on MacOS Ventura (M1 Chip arm64), Linux (x64), and Windows(x64) platforms. One issue that I've got so far is shown in the below picture which you may wanna consider:
msvc2019_err
Still, I'll provide a hot fix with this PR anyway. Have a good one!

@xiaozhuai
Copy link
Owner

xiaozhuai commented Jan 25, 2024

Hello @omrdk , thanks for the PR!
Have a good day!

I don't think this is the rignt fix for the problem, the key is that msvc has define min and max macro.
We can define #define NOMINMAX to disable it. then it will compile.

Could you please try the following patch?
fix_msvc.patch
Just download it and exec git apply /path/to/fix_msvc.patch.

I've update this pr, no need to download above patch file.
You can directly pull your branch to see whether it works or not.

@xiaozhuai xiaozhuai self-assigned this Jan 25, 2024
@xiaozhuai xiaozhuai added the bug Something isn't working label Jan 25, 2024
@omrdk
Copy link
Contributor Author

omrdk commented Jan 25, 2024

Hello @omrdk , thanks for the PR! Have a good day!

I don't think this is the rignt fix for the problem, the key is that msvc has define min and max macro. We can define #define NOMINMAX to disable it. then it will compile.

Could you please try the following patch? fix_msvc.patch Just download it and exec git apply /path/to/fix_msvc.patch.

I've update this pr, no need to download above patch file. You can directly pull your branch to see whether it works or not.

Well, disabling min and max macros didn't fix the compiling issue on my end, but changing the precedence seems to have more of an effect to prevent the conflict @xiaozhuai. Cheers!

@xiaozhuai xiaozhuai merged commit 2215764 into xiaozhuai:master Jan 26, 2024
@xiaozhuai
Copy link
Owner

Well, disabling min and max macros didn't fix the compiling issue on my end, but changing the precedence seems to have more of an effect to prevent the conflict @xiaozhuai. Cheers!

Well done! Thanks again for the pr. Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants