mingw32: linking libdvju and djvu plugin static

Bug #1768928 reported by djcj
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qpdfview
Fix Released
Medium
Adam Reichold

Bug Description

I've attached a patch that makes it possible to link the djvu plugin statically in Qt5 and to link libdjvulibre statically in mingw32 (had dll export issues).

Revision history for this message
djcj (djcj) wrote :
Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello djcj,

thank you for your contribution! I will commit this to trunk. One question though: You undefine DJVUAPI_EXPORT, DDJVUAPI_EXPORT and MINILISPAPI_EXPORT, but only define DDJVU_API and MINILISPAPI. Why not DJVU_API?

Best regards, Adam.

Changed in qpdfview:
status: New → Incomplete
importance: Undecided → Medium
assignee: nobody → Adam Reichold (adamreichold)
milestone: none → 0.4.18
Revision history for this message
Adam Reichold (adamreichold) wrote :

Looking at the DjVuLibre headers on my system, I cannot find DJVUAPI_EXPORT at all? Also are you sure that you need to undefine the *_EXPORT variants? From looking at

#ifndef DDJVUAPI
# ifdef _WIN32
# ifdef DDJVUAPI_EXPORT
# define DDJVUAPI __declspec(dllexport)
# else
# define DDJVUAPI __declspec(dllimport)
# endif
# endif
#endif
#ifndef DDJVUAPI
# define DDJVUAPI /**/
#endif

just defining DDJVUAPI should be sufficient? (Also defining them to something like /**/ seems a safer choice than an empty value.)

Revision history for this message
djcj (djcj) wrote :

Okay, it looks like I really don't need to edit djvumodel.cpp. Adding the following line to qpdfview_win32.pri is enough: DJVU_PLUGIN_DEFINES += DDJVUAPI= MINILISPAPI=
(trailing equal sign is needed or the build fails for me)

The fix inside pluginhandler.cpp is needed (Q_IMPORT_PLUGIN(DjvuPlugin) -> Q_IMPORT_PLUGIN(DjVuPlugin)).

Revision history for this message
Adam Reichold (adamreichold) wrote :

Hello again,

pushed this to trunk, please check if that variant works for you. (Editing djvumodel.cpp is fine IMHO, so I just simplified the defines a bit.)

Best regards,
Adam

Changed in qpdfview:
status: Incomplete → Fix Committed
Changed in qpdfview:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.