Compilation of Microsoft CRT 11 (msvcrt110.dll). What is the correct order of inclusions?

I am trying to compile Microsoft CRT 11 myself (the version that comes with VS2012).

I know that before VS2008 this action was fully supported by Microsoft:

http://msdn.microsoft.com/en-us/library/k9a8ehy3(v=vs.90).aspx

But with VS2010 you should no longer do this, and I know about the risks (basically - compiling it incorrectly and with problems that you cannot understand or solve)

I use the following directories that come with VS as input code and header files:

Code: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src Headers: C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include C:\Program Files (x86)\Windows Kits\8.0\Include\shared C:\Program Files (x86)\Windows Kits\8.0\Include\um C:\Program Files (x86)\Windows Kits\8.0\Include\WinRT 

(So ​​far, the only changes I have made are to remove some MSIL sources from the project)

Most of the code is already compiled. But I can not compile the file

  C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\assert.c 

Because of a mistake:

  error C3861: '_ReturnAddress': identifier not found 

If I add

  #include <intrin.h> 

he resolved. But I think that it should be allowed without direct code changes.

Of course, I constantly face new challenges. But I think the solution for the current one is to fix the included header order. In what order should the directories be used?

+5
source share
1 answer

You can forcefully include (without changing the source code) into the visual studio project (although I'm not sure if this is the best solution).

To do this, right-click on .c in the solution explorer, then go to C / C ++ β†’ Advanced β†’ Force Include File and add intrin.h (or add / FI "intrin.h" on the command line).

+2
source

Source: https://habr.com/ru/post/1207492/


All Articles