9

I need to modify the C runtime which ships with VS2010 because the 2010 CRT relies on functions released in Windows XP SP2, and I need to be able to deploy to Windows 2000.

Specifically, I need to remove any and all calls to EncodePointer and DecodePointer.

The source for the C runtime is included in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src, so it seems like it should be possible to build the runtime after slightly modifying the source.

Oh, I don't need to be able to build the dynamic versions of the runtime -- static versions only. (I cannot rely on the user installing the CRT on their system either).

With VS2008 and earlier, there was a tutorial in MSDN describing how to build the CRT, but I can't seem to find it for 2010.

Is such a thing possible?

Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
  • Possible dupe: http://stackoverflow.com/questions/2484511/can-i-use-visual-studio-2010s-c-compiler-with-visual-studio-2008s-c-runtime – Clark Gaebel Aug 11 '10 at 21:26
  • @Clark: No, that question is about using VS2008's CRT with VS2010. Here I'm asking if I can use VS2010's CRT, but modify it to remove the dependence myself. – Billy ONeal Aug 11 '10 at 21:28
  • They certainly seem to be doing their best it discourage, if not outright stop it. You need to change your mentality and become an "IDE user" instead of a programmer. – Jerry Coffin Aug 12 '10 at 19:55
  • No, you do not need to build CRT to do what you need. All you need is to replace the EncodePointer and DecodePointer, which is surprisingly easy to do. See my answer in your other question. – Suma Aug 17 '10 at 16:36
  • As you said: "With VS2008 and earlier, there was a tutorial in MSDN describing how to build the CRT". I need the link. It's hard to find. – Bùi Văn Thủ Sep 21 '20 at 16:55

3 Answers3

6

Here's an MSDN link. It looks like you have to do it yourself in VS2010.

You can use the following compiler and linker options to rebuild the MFC, CRT, and ATL libraries. Starting in Visual C++ 2010, scripts for rebuilding these libraries are no longer shipped.

Niall C.
  • 10,878
  • 7
  • 69
  • 61
0

"Oh, I don't need to be able to build the dynamic versions of the runtime -- static versions only."

Since you only need static linking, you can try this trick to provide implementations of EncodePointer and DecodePointer.

Community
  • 1
  • 1
user281806
  • 1,020
  • 9
  • 14
0

If it is a option, I would consider using the VC++ 2008 toolset within VS2010 instead of building a custom CRT. The procedure is explained here.

KeatsPeeks
  • 19,126
  • 5
  • 52
  • 83
  • That's what I'm already doing. The reason that really stinks is that I'd like to use things like `std::unique_ptr` and move semantics, which are available only with VS 2010's compiler. – Billy ONeal Aug 11 '10 at 21:17
  • I agree, I mentioned this solution just in the case you had not thought of it. Good luck. – KeatsPeeks Aug 11 '10 at 21:30