hi,

i have been trying to import plugins to a library and link that library to another application.

the library pro file is as the following:
Qt Code:
  1. TEMPLATE = lib
  2. HEADERS += testFile.h
  3. SOURCE += testFile.cpp
  4. CONFIG += debug static
  5. RESOURCES += testFile.qrc # the images are stored as resources
  6. QTPLUGIN += qjpeg
To copy to clipboard, switch view to plain text mode 

I use the Q_IMPORT_PLUGIN(qjpeg) in the library source file.

the content of the application pro file is as follows:
Qt Code:
  1. TEMPLATE = app
  2. SOURCES += main.cpp
  3. CONFIG += debug qt x11
  4. LIBS += libTestFile.a # the library mentioned above
To copy to clipboard, switch view to plain text mode 

the code block is as follows:
Qt Code:
  1. int main(int argc, char* argv[])
  2. {
  3. QApplication app(argc, argv);
  4. testFile file1; // constructs a toolbar having an icon (a jpeg image is used as icon)
  5. file1.show(); // shows the toolbar
  6. return app.exec();
  7. }
To copy to clipboard, switch view to plain text mode 

without using the libraries and embedding the library code into the application code, the jpeg file is displayed correctly.

when using libraries, the jpeg plugin's static library is not linked to my library and when I compile the application, I get an error message regarding the Q_IMPORT_PLUGIN (undefined reference to qt_plugin_instance_qjpeg()). when I add
Qt Code:
  1. QTPLUGIN += jpeg
To copy to clipboard, switch view to plain text mode 
to the pro file of the application, the application is built but the image is not visible on the toolbar.

how can I embed the images to the library and use it in the application ?