c++ - How to statically link Qt image formats plugins for WebKit? -


i need qwebview display images, instead of question marks displays.

i have found need link image plugins application so. have researched problem while now, , haven't found satisfying solution.

i followed these steps:

1) have added in project folder , folder in application compiled folder named: imageformats/ in have put these folowing plugins: libqgif.so , libqjpeg.so

2) have added project configuration file (.pro) this:

 qtplugin     += qjpeg \                  qgif  

3) , have added .cpp containg main function of project this:

#include <qtplugin>  q_import_plugin(qjpeg) q_import_plugin(qgif) 

and following errors:

main.cpp:(.text.startup+0xce): undefined reference `qt_plugin_instance_qjpeg()' main.cpp:(.text.startup+0xda): undefined reference `qt_plugin_instance_qgif()' 

i tried changing directory plugins/imageformats/, made no difference whatsoever.

for me (on ubuntu 12.04), didn't have libjpeg , dev headers installed.

$ sudo apt-get install libjpeg62-dev 

(which install libjpeg62 if don't have it).

after this, qtwebview showed jpeg images without modifications.


Comments