luspi / photoqt

PhotoQt Image Viewer (mirror repo) - https://photoqt.org
GNU General Public License v2.0
49 stars 11 forks source link

[CMake/FindFreeImage] Link libfreeimage #2

Closed jakar closed 6 years ago

jakar commented 6 years ago

Linker encountered undefined references (eg, FreeImage_Initialise) when only linking with libfreeimageplus. This adds the C library to solve the issue.

Since others can apparently build without linking libfreeimage, the way that I added the library is probably less than 100% correct. But I'm not sure how to improve it at the moment.

Error text:

CMakeFiles/photoqt.dir/cplusplus/main.cpp.o: In function `main':
main.cpp:(.text.startup+0x226): undefined reference to `FreeImage_Initialise'
CMakeFiles/photoqt.dir/cplusplus/mainhandler.cpp.o: In function `MainHandler::aboutToQuit()':
mainhandler.cpp:(.text+0x30ba): undefined reference to `FreeImage_DeInitialise'
CMakeFiles/photoqt.dir/cplusplus/imageprovider/imageproviderfull.cpp.o: In function `ImageProviderFull::requestImage(QString const&, QSize*, QSize const&)':
imageproviderfull.cpp:(.text+0x8d82): undefined reference to `FreeImage_SetOutputMessage'
imageproviderfull.cpp:(.text+0x8db1): undefined reference to `FreeImage_GetFileType'
imageproviderfull.cpp:(.text+0x8e0f): undefined reference to `FreeImage_FIFSupportsReading'
imageproviderfull.cpp:(.text+0x8e3d): undefined reference to `FreeImage_Load'
imageproviderfull.cpp:(.text+0x8e94): undefined reference to `FreeImage_GetWidth'
imageproviderfull.cpp:(.text+0x8ea0): undefined reference to `FreeImage_GetHeight'
imageproviderfull.cpp:(.text+0x8ead): undefined reference to `FreeImage_OpenMemory'
imageproviderfull.cpp:(.text+0x8eb9): undefined reference to `FreeImage_ConvertTo24Bits'
imageproviderfull.cpp:(.text+0x9350): undefined reference to `FreeImage_GetFIFFromFilename'
imageproviderfull.cpp:(.text+0x9966): undefined reference to `FreeImage_SaveToMemory'
imageproviderfull.cpp:(.text+0x9a2a): undefined reference to `FreeImage_Unload'
imageproviderfull.cpp:(.text+0x9a54): undefined reference to `FreeImage_AcquireMemory'
collect2: error: ld returned 1 exit status
CMakeFiles/photoqt.dir/build.make:6852: recipe for target 'photoqt' failed
make[2]: *** [photoqt] Error 1
make[2]: Leaving directory '/home/jake/local/src/photoqt/build'
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/photoqt.dir/all' failed
make[1]: *** [CMakeFiles/photoqt.dir/all] Error 2
make[1]: Leaving directory '/home/jake/local/src/photoqt/build'
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2