Search code examples
c++windowsqtqt5.1

Missing lib file when building QwtPlot3d with Qt 5.1.1


I am trying to build qwtplot3d library with Qt 5.1.1. Everything seems to be build fine and it generated .dll file but I couldn't find .lib file must be generated. I have pulled source code from trunk but it seems it didn't build with Qt5(may be it built with Qt4). May be this is a QT5 porting problem but I couldn't any solution.

Do you have any idea?


Solution

  • The problem was the preprocessor definitions defined in qwt3d_global.h. Here is my some solutions to overcome this problem.

    replace below line, Q_WS_WIN is no longer used by QT5 so that replace it with Q_OS_WIN preprocessor definition.

    #if defined(Q_WS_WIN) 
    with
    #if defined(Q_OS_WIN)
    

    and then, Add following code line to export the missing library, current definitions is not being used but they are still in this file, I don't know why.

    #if defined(QWT3D_EXPORT_DLL)
    #  define QWT3D_EXPORT Q_DECL_EXPORT
    #else
    #  define QWT3D_EXPORT Q_DECL_IMPORT
    #endif
    

    By the way, don't forget to add QWT3D_EXPORT_DLL definitions into preprocessor definitions in VS settings, or define it somewhere else

    or just add QWT3D_DLL, QWT3D_MAKEDLL definitions into preprocessor definitions, or define them at somewhere else; otherwise it can't generate lib file at all.