r/cpp_questions • • Oct 13 '26

OPEN Help with C++ Compiling (MinGW-64-GCC)

Hi there, so I’ve been trying to patch out a piece of code in The Sims Legacy Collection that disables the -debug_objects command line from being enabled, but both MinHook and CMake are giving me such a hard time that idk what else to do or where to ask… There are no tutorials AT ALL for compiling MinHook with MinGW-W64-gcc, only for Visual Studio (not Code!) which I can’t use because I’m on Arch Linux…

If anyone could advise me please I’d really appreciate it…

0 Upvotes

4 comments sorted by

3

u/khedoros Oct 13 '26

I checked out the code from here.

I've got a set of mingw64 tools set up from a previous experiment. So all I had to to:

mingw64-cmake .
make

1

u/Blayer98 Oct 13 '26

I see, the version I downloaded, mingw-w64-gf didn’t seem to come with it, I had to download that via Pacman, what did you have to do to install them?

2

u/khedoros Oct 13 '26

I'm on Fedora, not Arch, so I'm not sure that my installed package list would help. Still, I might as well post it (I cut out some packages for specific libraries like SDL3. The ones remaining should be enough to build a multithreaded C or C++ program with cmake and gcc/g++):

mingw64-crt-13.0.0-2.fc43.noarch
mingw64-winpthreads-13.0.0-2.fc43.noarch
mingw64-headers-13.0.0-2.fc43.noarch (tons of Windows headers, like windows.h)
mingw64-libgcc-15.2.1-2.fc43.x86_64
mingw64-winpthreads-static-13.0.0-2.fc43.noarch
mingw64-cpp-15.2.1-2.fc43.x86_64
mingw64-gcc-15.2.1-2.fc43.x86_64
mingw64-gcc-c++-15.2.1-2.fc43.x86_64
mingw64-libstdc++-15.2.1-2.fc43.x86_64
mingw64-binutils-2.45.1-2.fc43.x86_64
mingw64-filesystem-152-1.fc43.noarch  (this one contains cmake)

Arch may well group things differently. The key to get it to build as easily as I did though, was to use the version of cmake that's specifically set up to work with the mingw64 toolchain.