7

I get the following compilation error

fatal error C1189: #error : ERROR: Use of C runtime library internal header file.

I absolutely have no idea about it. can anyone throw some light on it?

The complete error:

C:\Program Files\Microsoft Visual Studio 8\VC\ce\include\crtdefs.h(100) : fatal error C1189: #error : ERROR: Use of C runtime library internal header file. Generating Code...

  • It would hope if you included the code or the name of the file that produces the error. – SoapBox Jan 30 '09 at 00:33
  • C:\Program Files\Microsoft Visual Studio 8\VC\ce\include\crtdefs.h(100) : fatal error C1189: #error : ERROR: Use of C runtime library internal header file. Generating Code... –  Jan 30 '09 at 00:34

2 Answers2

14

You've probably got crt/src in your include directory search path. The headers in there are used to build the C Runtime - they aren't intended for use in user programs (even though they may have the same names as files that are intended to be included).

If you look in the header that's causing the problem, you'll probably see something like this:

/* This version of the header files is NOT for user programs.
 * It is intended for use when building the C runtimes ONLY.
 * The version intended for public use will not have this message.
 */

You need to fix your include search path.

I see you have ce/include in your include search path - are you building a WinCE application? If so, your build should be defining _WIN32_WCE to prevent this problem. If not, this directory should not be in the include path.

Michael Burr
  • 333,147
  • 50
  • 533
  • 760
  • This was close to my issue. I had to switch the target platform for a class library in my solution from PocketPC to Win32. Not sure how it started that way... – Chuck Callebs Aug 18 '11 at 17:58
3

To add a bit of precision, in my case I just needed to change the Include path of one of the .h files I used as shown below.

I started with this Include path :

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src

and then changed it to:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include

which is where the right header file was located.

Julien
  • 83
  • 2
  • 7
  • I know this is a old question, but I would like a little support. Where did you modified the include path? I looked at ../common/wince/qmake.conf and at the current qmake.conf, but I can't find it. Any help will be appreciated – Giox79 Feb 22 '15 at 10:37
  • @Giox79 Unfortunately, I've completely forgotten what project of mine this was, but you can change a project's additional include directories in VC++. Project properties > (Debug/Release/etc.) > C/C++ > Additional Include Directories. [link This page has further details](http://stackoverflow.com/questions/335408/where-does-visual-studio-look-for-c-header-files#answer-335426) though VC++ now prefers not to use the third option. – Julien Feb 23 '15 at 17:08