r1ch.net forums
* Home Help Search Login Register
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Building r1q2 on Win32/VisualC without Visual Studio (a.k.a. The Hard Way™)
Pages: [1]
Print
Author Topic: Building r1q2 on Win32/VisualC without Visual Studio (a.k.a. The Hard Way™)  (Read 19587 times)
retropia
Member

Posts: 3


« on: December 12, 2011, 05:45:46 pm »

I've always been really uncomfortable with Visual Studio. Not only is it an unwieldy behemoth to use, but it also seems to enforce the recent Microsoft policy of not linking against their system C runtime (MSVCRT.dll), but rather against a versioned DLL (MSVCRTXX.dll) that the developer is expected to provide. For those interested, there's more backstory here and here. It's an annoying practice, since Microsoft's own apps (e.g. notepad.exe) themselves have linked against MSVCRT.dll since forever - making it an essential system component.

The solution? The author of the latter blog post provided a set of scripts that set up a command-line build environment with a tool-chain that supports MSVCRT.dll linking. I've removed the remaining dependencies on Visual Studio, meaning that only two components are required for this build:

 - the Windows Driver Development Kit (yes, you read that right! The DDK contains the toolchain necessary for linking against MSVCRT.dll)
 - the Windows SDK

both of which are provided as free downloads by Microsoft. The modified scripts can be found here.

As I've added the complete build instructions to my r1q2.txt, I won't repeat them here. In that git repo are also NMAKE Makefiles, which the instructions rely upon. If you happen to run into any problems (I've tested this only on Win7 x64), feel free to let me know!
Logged
QwazyWabbit
Member

Posts: 402


« Reply #1 on: December 12, 2011, 11:37:49 pm »

This is interesting because R1ch's version of r1q2.exe doesn't depend on MSVCR*.DLL except indirectly via WINMM.DLL and the other DLL's like ADVAPI32.DLL and then only on MSVCRT.DLL.

R1ch's release is the only one that works with his anti-cheat dll so that's the only one that needs to be portable across Windows platforms. All other versions compiled from source only need to run in the platform they were compiled on.
Logged
retropia
Member

Posts: 3


« Reply #2 on: December 13, 2011, 09:01:05 pm »

This is interesting because R1ch's version of r1q2.exe doesn't depend on MSVCR*.DLL except indirectly via WINMM.DLL and the other DLL's like ADVAPI32.DLL and then only on MSVCRT.DLL.

I suspect this is because the release builds link with /MT rather than /MD (even though the supplied project file does the opposite). In either case, Visual C++ 6 will never create a dependency on a MSVCRTXX.DLL but in one of the cases Visual Studio 2003+ will.
Logged
QwazyWabbit
Member

Posts: 402


« Reply #3 on: December 14, 2011, 03:39:31 pm »

It was my understanding that r1ch was building with VS 2005 or 2008 Express edition. All VS editions after VS6 build against their own C runtimes, VS 6 only used MSVCRT.DLL and MSVCRTD.DLL
Logged
Pages: [1]
Print
r1ch.net  |  r1ch.net stuff  |  R1Q2  |  Topic: Building r1q2 on Win32/VisualC without Visual Studio (a.k.a. The Hard Way™)
Jump to:  

Powered by SMF 1.1.19 | SMF © 2013, Simple Machines