Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by StoneMask May 28, 2012 at 10:46 PM 4 replies 19.3k views
Original Post
StoneMask
StoneMask
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...
frob
frob
What is your exact error message?
StoneMask
StoneMask
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?
Deranged
Deranged
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.
jamby
jamby

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.
Aardvajk
Aardvajk

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 . 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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.