Hi
I'm trying to load an image into a QPixmap object, here is my code:
QPixmap blackKingPixmap;
std::cout << "Hello";
blackKingPixmap.load("images/black_king.png");
std::cout << "Hello";
When I run it, I only see one 'Hello' printed to the console, shortly after that the program terminates without printing the second 'Hello'.
I don't get any error messages when I run it, it simply just terminates. I have tried putting the 'images' folder in the 'resources' folder, and in the same folder as the .cpp file. I have tried taking the images out of the folder and putting them directly in the 'resources' folder. I have tried specifying the absolute path to the image ('C:<user>/ etcetc'). I even tried loading the image to a QImage first and then trying to create the QPixmap from the QImage. I have checked that the image definitely exists at the specified path, and that the permissions for accessing the image are correct. All of which to no avail! Basically I have tried everything that I (or ChatGPT) could think of to fix it, none of it worked.
Can someone please help me? (Or put me out of my misery haha)
Thanks a lot,
Michael
