r/cpp_questions • u/LotaSpaghetti • 1d ago
OPEN Help With Using Standard Libraries In My Hyper-Specific Project
Hello, everyone. I've recently taken up a project where I work to streamline and rewrite an originally vibecoded project which allowed for the creation of custom DLLs which could be loaded by the game Serious Sam 2. From what I've gathered, the AI that wrote the original project created an environment isolated from the rest of the system and does not allow access to any standard library features. I've looked through this project's makefile to try and find what exactly is causing this and how to rectify it. Unfortunately, I do not believe that I am skilled or knowledgeable regarding makefiles to diagnose the problem and solve it. I have moving the code elsewhere and using auto-generated cmake files from IDEs such as CLion, and the library would compile, but Serious Sam 2 then refuses to recognize it. I know this is more of a niche problem compared to most of what gets posted here, but I'd really really really appreciate if some more experienced members could help out here! I would love to learn what the issue is and maybe how makefiles in general work. My experience with them is kinda subpar admittedly.
Here's the repo to the current version of my project:
3
u/dvd0bvb 1d ago
I'd guess -ffree-standing and -fno-builtin and the msvc equivalents have something to do with it. Idk what kind of implications removing them has for your lib
1
u/Chaosvex 21h ago
You're a little vague about the actual issues you're experiencing but at a glance, _DllMainCRTStartup is supposed to be provided for you and performs CRT initialisation, with DllMain being the project-provided entry point. You might need to look into the specifics for mingw.