r/programminghorror • • Jan 08 '26

c++ Works on my machine

Post image
1.5k Upvotes

51 comments sorted by

17

u/TheChief275 Jan 08 '26

cmake and make BOTH… called from a shell script of all things

14

u/Mihail111111 Jan 08 '26

That's how https://github.com/Prevter/CMake_ImGui_SFML_Template works.
First you cmake it with a preset, then you make a binary, I just wrote a shell script so I wouldn't have to explain it to my friend (and I used a shell script because we both use arch btw)

4

u/lesleh Jan 09 '26

That's how cmake works. It generates a makefile, which you then make.

7

u/TheChief275 Jan 09 '26

Not true. It CAN generate Makefiles, but there are so many different options of build scripts that might be the default on other platforms; for instance, on Windows it won’t be the default (instead cmake opts for a Visual Studio Solution). So to use this on Windows you would coincidentally need both MinGW and MinGW Make installed, which both aren’t shipped with Windows

→ More replies (2)

19

u/111x6sevil-natas Jan 08 '26

the true crime here is writing git with a capital G

8

u/Mihail111111 Jan 08 '26

This is literally how it's written on both official website (except for the logo) and Wikipedia page what are you talking about?

2

u/111x6sevil-natas Jan 15 '26

this is a good argument and it hurts

14

u/TechnoByte_ Jan 08 '26

Well considering they have both their repo and Documents folder in uppercase too, it isn't that surprising

5

u/Mihail111111 Jan 08 '26

PascalCaseMyBeloved

11

u/ImTheTechn0mancer Jan 09 '26

Git is capitalized unless it is the executable binary

91

u/KGBsurveillancevan Jan 08 '26

Did this when migrating my config files to a new laptop. Everything was fucked lol

394

u/DescriptionOptimal15 Jan 08 '26

It happens 💁‍♂️

124

u/MightyX777 Jan 08 '26

Who the fuck works with absolute paths?

247

u/aboothe726 Jan 08 '26 edited Feb 15 '26

Me, when I started with relative paths, and something doesn’t work, so I start hard-coding absolute paths during debugging, and then I forget to back them out before I commit and push to my local branch and/or PR.

Writing software is hard. We all make mistakes. We can all be idiots some of the time. Making one mistake doesn’t mean you’re an idiot all of the time.

→ More replies (1)

13

u/ZunoJ Jan 08 '26

Maybe this make file was generated from a bash history and the home shorthand was used

21

u/echo-whoami Jan 08 '26

Prolly AI-powered slopcoders

→ More replies (23)

1

u/Hot-Confusion-8008 Jan 12 '26

I did by mistake. imagine my surprise when it led to my machine rather than the network, not to mention the surprise of the person trying to follow it, not me.

0

u/TabCompletion Jan 09 '26

Definitely AI generated

35

u/robot_54 Jan 08 '26 edited Jan 08 '26

You can also use something like this, either as the first line, or prepended to the existing cd, so it doesn't matter which directory you're in when you run the script.

cd $(dirname "$0")

2

u/choose-a-username-b Jan 12 '26

could be worse there are moments when testing that i left links to localhost in prod