1
General / Re: examples not working
« on: July 01, 2021, 09:38:15 am »
Thank you eXpl0itr3r, the idiot I am I didn't think of running the program via the command line to get the error message.
I just record my solution here, in case somebody else runs into a similar problem (or I run into it again in a couple of years from now)
So here is the solution for the problem I had:
open a command prompt, and CD to the examples dir, e.g. go to opengl\
Then run opengl > a.txt 2>&1
(I needed to include the magic > a.txt 2>&1 in order to catch the error message, otherwise the program crashes without an error statement, for whatever reason)
The error is now in a.txt , which was in my case "Failed to load image "resources/background.jpg". Reason: Unable to open file"
The problem is now obvious : I compiled using cmake to a build dir which was not the same as the resources dir. The stuff in resources/ was not copied over, so the program couldn't find background.jpg (and the other stuff) and therefore crashed.
I just record my solution here, in case somebody else runs into a similar problem (or I run into it again in a couple of years from now)
So here is the solution for the problem I had:
open a command prompt, and CD to the examples dir, e.g. go to opengl\
Then run opengl > a.txt 2>&1
(I needed to include the magic > a.txt 2>&1 in order to catch the error message, otherwise the program crashes without an error statement, for whatever reason)
The error is now in a.txt , which was in my case "Failed to load image "resources/background.jpg". Reason: Unable to open file"
The problem is now obvious : I compiled using cmake to a build dir which was not the same as the resources dir. The stuff in resources/ was not copied over, so the program couldn't find background.jpg (and the other stuff) and therefore crashed.