Results 1 to 6 of 6

Thread: QTPLUGIN += qjpeg doesnt let me compile

  1. #1
    Join Date
    Feb 2010
    Posts
    64
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default QTPLUGIN += qjpeg doesnt let me compile

    Hi guys,

    Im triying to save pictures as jpeg format. I do what trolls said in http://doc.trolltech.com/4.3/plugins...static-plugins
    but when I include the line
    Qt Code:
    1. QTPLUGIN += qjpeg
    To copy to clipboard, switch view to plain text mode 

    then, error: collect2: ld returned 1 exit status appears. What am I doing wrong?

    thanks

  2. #2
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QTPLUGIN += qjpeg doesnt let me compile

    Have you rebuild qjpeg plugin as static library?

  3. #3
    Join Date
    Feb 2010
    Posts
    64
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTPLUGIN += qjpeg doesnt let me compile

    I have all the libraries in C:\Qt\2010.01\qt\plugins\imageformats. I have qjpeg4.dll, qjpeg4d.dll, qjpeg4.a, qjpeg4d.a

  4. #4
    Join Date
    Jun 2010
    Location
    Salatiga, Indonesia
    Posts
    160
    Thanks
    11
    Thanked 32 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    1

    Default Re: QTPLUGIN += qjpeg doesnt let me compile

    Quote Originally Posted by locke View Post
    I have all the libraries in C:\Qt\2010.01\qt\plugins\imageformats. I have qjpeg4.dll, qjpeg4d.dll, qjpeg4.a, qjpeg4d.a
    No, all files you mention are dynamic plugins. You must build the qjpeg plugin as a static plugin.

    Quoting from http://doc.trolltech.com/4.3/plugins...static-plugins
    It is also possible to create your own static plugins, by following these steps:

    1. Add CONFIG += static to your plugin's .pro file.
    2. Use the Q_IMPORT_PLUGIN() macro in your application.
    3. Link your application with your plugin library using LIBS in the .pro file.

  5. The following user says thank you to saa7_go for this useful post:

    locke (16th August 2010)

  6. #5
    Join Date
    Feb 2010
    Posts
    64
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTPLUGIN += qjpeg doesnt let me compile

    I changed the things and now it works. But the way I did it is like I was creating a new plugind, not using an exsiting one. Istead of include the jpeg plugin like QTPLUGIN += qjpeg I needed to compile the plugins statically and then link the libraries using LIBS in my .pro file.

  7. #6
    Join Date
    Jul 2009
    Posts
    41
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTPLUGIN += qjpeg doesnt let me compile

    I tried to do this as well (on a Macintosh) and I"m getting errors like the following:

    Undefined symbols for architecture x86_64:
    "qt_plugin_instance_qjpeg()", referenced from:
    __static_initialization_and_destruction_0(int, int)in main.o

    Anyone know how to fix this issue?


    P.S. --- I looked in the libqjpeg.dylib with nm and noted that there is an entry called _qt_plugin_instance, but there is NOT an entry called _qt_plugin_instance_qjpeg, which is being defined by the Q_IMPORT_PLUGIN macro.
    Last edited by dhjdhj; 22nd February 2011 at 20:39.

Similar Threads

  1. Use of a factory in a QTPlugin
    By PeterPaulAndMary in forum Qt Programming
    Replies: 7
    Last Post: 21st July 2010, 18:35
  2. QtPlugin and undefined symbol
    By Mikoskay in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2010, 12:04
  3. Problem using QtPlugin
    By merry in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2008, 06:49
  4. QtPlugin compile issue
    By croland in forum Qt Programming
    Replies: 2
    Last Post: 25th May 2007, 16:37
  5. MySql and QtPlugin
    By darksaga in forum Installation and Deployment
    Replies: 6
    Last Post: 15th May 2007, 10:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.