I'm new to Qt6. In Qt6.4.3, I'm writing a simple console app in c++ to load a .jpg file into a QImage object. On my Ubuntu 6.22.04 machine, I'm getting the following error: "/main.cpp:40: undefined reference to `QImage::load(QString const&, char const*)'" I have the following in my includes:
#include <QtGui/QImage>
I declare the following as 3 consecutive lines:
QString filename="<fullpath>.JPG";
QImage img;
img.load(filename, "JPG");
I'm using cmake, but don't know whether that's relevant. Using Qt Creator 9.0.2. This approach used to work well in Qt5. I know someone's gonna call me an idiot or a lazy idiot or tell me to RTFM, so go ahead. Get it out of your system, but then please give me some useful advice.
Tried the statements above, attempted a build, and got the error shown above. I was expecting a QImage object returned stuffed with the .jpeg image I requested. My fullpath looks similar to "/mnt//Project/testme/blahblah.JPG". The path is correct with correct case and slashes. As I said this worked in Qt5.15. Figure I'm missing something stupid, but after spending all day searching the web, I haven't found the answer.