July 7, 2012

akrynski akrynski
Lab Rat
32 posts

[solved]QImageReader problem in console app

 

Hi!
I get following error:

  1. C:/PROGRAMOWANIE/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Release
  2. mingw32-make.exe[1]: Entering directory `C:/PROGRAMOWANIE/projekty/Qt/moje/dirs-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release'
  3. g++ -Wl,-s -Wl,-subsystem,console -mthreads -o release\dirs.exe release/main.o  -L"c:\PROGRAMOWANIE\QtSDK\Desktop\Qt\4.8.0\mingw\lib" -lQtCore4
  4. mingw32-make.exe[1]: Leaving directory `C:/PROGRAMOWANIE/projekty/Qt/moje/dirs-build-desktop-Qt_4_8_0_for_Desktop_-_MinGW__Qt_SDK__Release'
  5. release/main.o:main.cpp:(.text+0x8c): undefined reference to `_imp___ZN12QImageReader21supportedImageFormatsEv'
  6. collect2: ld returned 1 exit status
  7. mingw32-make.exe[1]: *** [release\dirs.exe] Error 1
  8. mingw32-make.exe: *** [release] Error 2

when compiling on Windows. With Ubuntu all goes right, with no problem so it must be something with included header file for this class.
The code that i use is following:

  1. foreach (QByteArray format, QImageReader::supportedImageFormats())

Any idea how to solve it?

 Signature 


Pozdrawiam i do nastÄ™pnego…
Greetings and till next…

2 replies

July 7, 2012

Lukas Geyer Lukas Geyer
Dinosaur Breeder
2074 posts

QImageReader is in the QtGui module, to which you obivously don’t link to.

Did you forget QT += gui in your .pro file?

July 7, 2012

akrynski akrynski
Lab Rat
32 posts

Holly s… what a shame ;)
yeah I had QT -=gui
But…
I compiled it earlier on Linux without any errors. Strange. :o
Thanks a lot.

 Signature 


Pozdrawiam i do nastÄ™pnego…
Greetings and till next…

 
  ‹‹ Is that bug ?      Inconsistent look of widgets in OS X Lion ››

You must log in to post a reply. Not a member yet? Register here!