4

I converted my python program into c code with Cython. Now I'm having trouble compiling it with the MS Visual studio compiler. I'm getting the error

C:\Python34\include\pyconfig.h(68) : fatal error C1083: 
Cannot open include file: 'io.h': No such file or directory

I'm running the command from the conosle

cl /c main.c /nologo /Ox /MD /W3 /GS- /DNDEBUG 
-Ic:\Python34\include -Ic:\Python34\PC /link /OUT:"main.exe" 
3
  • How did you configure Cython for MSVC? Do you have the same version of MSVC that was used to build your Python (and Cython)? Commented Nov 27, 2014 at 0:44
  • 2
    Is the INCLUDE environment variable set to the MSVC include directory? e.g. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE Commented Nov 27, 2014 at 1:55
  • 1
    @eryksun Do you mean set a second path variable to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE ? Yes, I just tried that. I get the same error.. Commented Nov 27, 2014 at 9:37

1 Answer 1

3

I navigated to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include on my computer, and the file io.h did not exist. It seems that that the problem is the file, in fact, does not exist!

According to this other answer, it is a POSIX compatibility library: failing to compile a project, missing io.h file

I'm not sure why this file can be missing. This other answer suggested reinstalling things: Installation of Visual Studio 2010 (any edition) installs only 2 files in the C++ headers directory

Edit: Everything just worked when I navigated to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools. There were Developer Command Prompt for VS XXX shortcuts. I opened one of them and all the compilation commands succeeded.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.