3

I'm attempting to compile a C++ solution in VS 2010, but for some reason it can't locate the standard libraries.

I'm including as so:

#include <cstddef>

VS is returning an error as so:

main.cpp(10): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory

However, I check my installation directory, and it's right where it's supposed to be (VC\include), and this directory is a part of my include directory list in the project settings ($(VCInstallDir)include).

Any ideas why this is happening, and how I can fix it?

1 Answers1

-1

Give a try using #include <stddef.h> instead. However, MSVC 10 should have <cstddef>: msdn

However, as @captain-obvlious pointed out this may require additional changes in your code..

gmas80
  • 1,218
  • 1
  • 14
  • 44
  • That will pull everything into the global namespace instead of `std`. – Captain Obvlious Oct 26 '14 at 04:11
  • @captain-obvlious: Correct! Added a note – gmas80 Oct 26 '14 at 04:16
  • Try with the solution posted here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/a987f4fa-676f-4fda-ab69-2c6bcc2684c3/visual-studio-c-2012-standard-header-files-are-missing?forum=vssetup – gmas80 Oct 26 '14 at 04:26
  • No luck. Still throwing that error after uninstalling and re-installing. – Nuclear Whiskers Oct 26 '14 at 04:56
  • Did you check if the import header is physically on your pc? do you have different MSVCs or SDKs installed? These may help: http://stackoverflow.com/a/11535236/2741329 and http://stackoverflow.com/a/1102718/2741329 – gmas80 Oct 26 '14 at 06:26