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

Trouble building on Windows #22

Open
ngoldbaum opened this issue Aug 3, 2016 · 5 comments
Open

Trouble building on Windows #22

ngoldbaum opened this issue Aug 3, 2016 · 5 comments

Comments

@ngoldbaum
Copy link

When I try to build under python2.7 on Windows 10, I get the following error:

$ python setup.py build_ext -i
running build_ext
building 'cyglfw3.glfw3' extension
C:\Users\dxl\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\Users\dxl\Miniconda2\include -IC:\Users\dxl\Miniconda2\PC /Tccyglfw3/glfw3.c /Fobuild\temp.win-amd64-2.7\Release\cyglfw3/glfw3.obj -IC:/Users/dxl/glfw-3.2/include
glfw3.c
C:/Users/dxl/glfw-3.2/include\GLFW/glfw3.h(123) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\\Users\\dxl\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

I have the Microsoft visual C++ compiler for Python 2.7 installed and have GLFW_ROOT set to point to the glfw binaries from glfw.org.

@ngoldbaum
Copy link
Author

Hmm, maybe this is an upstream glfw issue? If I add stdint.h from http://snipplr.com/view.php?codeview&id=18199 to glfw's include directory I can compile.

@adamlwgriffiths
Copy link
Owner

I'd say there's an include path issue. stdint.h should be part of the MSVC redistributable package and included in MSVC 2010(?).
https://stackoverflow.com/questions/13642827/cstdint-vs-stdint-h
Although it was apparently missing from MSVC 2003 -> MSVC ?
https://stackoverflow.com/questions/126279/c99-stdint-h-header-and-ms-visual-studio

@ngoldbaum
Copy link
Author

Right, visual c++ for python 2.7 is based on MSVC 2008, so the release before they started bundling stdint.h. Unfortunately this is the compiler that Microsoft and the upstream python devs recommend for Python 2.7 C extensions on Windows, since that's the compiler that was used to build Python originally.

@adamlwgriffiths
Copy link
Owner

Hmm, it's a bit grey as to whether it's an external tool problem that requires a section in the README, or some sort of logic in the setup.py.
Is there a "proper" method to install this?
Thoughts?

@ngoldbaum
Copy link
Author

I think generally projects include a windows-specific version of stdint.h. I think this would need to happen in glfw proper. Also, looking at glfw3.h, it seems stdint.h is only included for vulkan support (according to the comment here: https://github.com/glfw/glfw/blob/master/include/GLFW/glfw3.h#L124) which indicates it was added recently, so maybe they didn't realize that this caused a regression for people on older windows versions or compiling stuff that depends on older versions of MSVC.

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

2 participants