Cannot open source file 'time.h', 'stdio.h'

Started by
4 comments, last by Aardvajk 11 years, 10 months ago
Just what the title says. Likewise, I cannot include Windows.h or use its data types.

- I am using Microsoft Visual Studios 2010 in combination with DirectX9.
- I have added the Lib/Include files to my Include directory, the x86 folder to my Lib directory, and the DxErr folder to my Source directory across all configurations
- I do not have "Ignore Standard Include Paths" ticked across all configurations
- My SDK is from June 2010.
- I have included the following in my Linker Input across all configurations

  • d3d9.lib
  • d3dx9.lib
  • DxErr.lib
  • dxguid.lib
  • dsound.lib
  • winmm.lib
  • dinput8.lib

- I am manipulating a Win32 project that started empty.
- None of my other DirectX programs are giving me this problem

Instead of using completely original files, I attempted to use existing source and header files from my other projects. Would that cause something like this? It doesn't seem very likely...
Advertisement
What is your exact error message?
Well, I haven't put together all the sources files together in a way that fits yet. It's that when I mouse over the preprocessor directives, there's a red line underneath and it says what it says in the title: Cannot open source file 'time.h', Cannot open source file 'stdio.h' etc. Those are pretty standard things, right? Like, I wouldn't be able to miss those if I tried?
Are the standard library folders in the include directories in the project settings? Also, if you're using C++ give cstdio and ctime a try instead.

Well, I haven't put together all the sources files together in a way that fits yet. It's that when I mouse over the preprocessor directives, there's a red line underneath and it says what it says in the title: Cannot open source file 'time.h', Cannot open source file 'stdio.h' etc. Those are pretty standard things, right? Like, I wouldn't be able to miss those if I tried?


If by this you mean you haven't actually compiled anything yet, well...do so. I've had red squiggly lines many times that were totally bogus; there was nothing wrong.

Well, I haven't put together all the sources files together in a way that fits yet. It's that when I mouse over the preprocessor directives, there's a red line underneath and it says what it says in the title: Cannot open source file 'time.h', Cannot open source file 'stdio.h' etc. Those are pretty standard things, right? Like, I wouldn't be able to miss those if I tried?


Add a .cpp to your project. Put in #include <time.h>. Select the 'Compile Unit' option to compile this file in isolation. If this compiles, its what jamby says. I've never seen false-positive squigglies on #includes though personally, so I suspect it isn't. Nice to know though.

Debugging your environment setup before you can actually compile anything is not my idea of a great day.

This topic is closed to new replies.

Advertisement