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

Compilation failure on Windows #819

Closed
joto opened this issue Feb 10, 2017 · 3 comments
Closed

Compilation failure on Windows #819

joto opened this issue Feb 10, 2017 · 3 comments

Comments

@joto
Copy link

joto commented Feb 10, 2017

Description

Version 1.7.1 fails to compile on Windows with error:

error C3861: 'AddVectoredExceptionHandler': identifier not found
error C3861: 'RemoveVectoredExceptionHandler': identifier not found

Looks like the same problem as #805, but this is not with Mingw, but MSVC.

You can see the build failure here: https://ci.appveyor.com/project/Mapbox/libosmium/build/job/fwvs2nol8mipx0j5

@philsquared
Copy link
Collaborator

I wonder if this is to do with this:

"To compile an application that uses this function, define the _WIN32_WINNT macro as 0x0500 or later. For more information, see Using the Windows Headers."

@horenmar
Copy link
Member

This is fairly interesting -- I looked at the build log from AppVeyor and the WINVER/_WIN32_WINNT macro is defined as 0x0500, see /D WINVER=0x0500 /D _WIN32_WINNT=0x0500

Judging by a quick look at https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745(v=vs.85).aspx#setting_winver_or__win32_winnt, this would indicate that you are building for pre-Windows XP version of Windows, which you obviously aren't, or at least shouldn't be. Now the question becomes WHY is it defined to that.

After looking at your build, I see that you are adding these explicitly for some reason. If you need to keep those, you can disable the SEH on Windows, for details see our documentation. Otherwise I recommend deleting these defines (they will be autodefined based on the OS version you build on), or bumping them up to at least 0x0502 (Windows XP SP 2).

@horenmar horenmar added the Resolved - pending review Issue waiting for feedback from the original author label Feb 11, 2017
@joto
Copy link
Author

joto commented Feb 15, 2017

It is unclear to me why we added those windows version settings to the build script in the first place. I have removed them and now everything builds fine. Thanks for the help!

@joto joto closed this as completed Feb 15, 2017
@horenmar horenmar removed the Resolved - pending review Issue waiting for feedback from the original author label Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants