Results 1 to 6 of 6

Thread: how can I add libpoppler plugin to my Qt4 project?

  1. #1
    Join Date
    Mar 2011
    Posts
    23
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how can I add libpoppler plugin to my Qt4 project?

    I compiled Qt 4.8.5 statically.
    I installed poppler to my linux system.
    I added to pro file:

    Qt Code:
    1. QTPLUGIN += poppler
    To copy to clipboard, switch view to plain text mode 

    and I added to main.cpp

    Qt Code:
    1. Q_IMPORT_PLUGIN(poppler)
    To copy to clipboard, switch view to plain text mode 

    Also I added libpoppler.a and libpoppler.so to my project as a system library.

    After I run project I get these errors:

    Qt Code:
    1. .../main.cpp:-1: error: undefined reference to `qt_plugin_instance_poppler()'
    2. :-1: error: collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

    how can I add libpoppler plugin to my Qt4 project?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how can I add libpoppler plugin to my Qt4 project?

    libpoppler is not a plugin, it is a normal library.

    You link against it using LIBS

    Cheers,
    _

  3. #3
    Join Date
    Mar 2011
    Posts
    23
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how can I add libpoppler plugin to my Qt4 project?

    Thank you @anda_skoa. My application works my computer and also other computers which Qt is not installed. But when I use a poppler function in other computers my application crashed. How can I add poppler statically to my ap

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how can I add libpoppler plugin to my Qt4 project?

    Like any other static library.
    Make sure it is found during the build and not a dynamic library version of itself and that all its dependencies are also available either as system libraries or also as static builds.

    Cheers,
    _

  5. #5
    Join Date
    Mar 2011
    Posts
    23
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how can I add libpoppler plugin to my Qt4 project?

    I compiled poppler statically with ./configure --enable-static & make & make install.

    I add these line to my pro file:

    Qt Code:
    1. unix:!macx:!symbian: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lpoppler-qt4
    2.  
    3. INCLUDEPATH += $$PWD/../../../../../../usr/include/poppler/qt4
    4. DEPENDPATH += $$PWD/../../../../../../usr/include/poppler/qt4
    5.  
    6. unix:!macx:!symbian: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/libpoppler-qt4.a
    To copy to clipboard, switch view to plain text mode 

    Also I copied needed so files(libpoppler-qt4.so and libpoppler.so)
    app works in my computer and in other computer. but app crashed in poppler class in other computer with segmentation fault error.

    Please help how can I add poppler to my app statically?

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,688
    Thanks
    13
    Thanked 1,598 Times in 1,526 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how can I add libpoppler plugin to my Qt4 project?

    If you have a statically built Poppler, and you link against it, then you do not have any *.so files to deploy. If they still exist alongside a static version the linker will generally prefer them while building your application.

    You also seem to be mixing the include files from a version of Poppler installed under /usr with the library from a version installed under /usr/local. This may not be a problem, or it might explain your original crashing problem.

Similar Threads

  1. Replies: 7
    Last Post: 11th April 2013, 11:55
  2. Replies: 4
    Last Post: 20th January 2013, 12:01
  3. Replies: 1
    Last Post: 29th September 2011, 12:14
  4. Replies: 1
    Last Post: 8th October 2010, 12:38
  5. Replies: 1
    Last Post: 4th December 2009, 00:34

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.