Hi Joerg, I'm not sure why it's still looking for a dynamic library. Check that qwtconfig.pri has QWT_CONFIG += QwtDll is commented out, and CONFIG += static added. Then delete the build-*** directories, re-run qmake, and try building it again and see if that fixes it?
I did some osx development last night, and kept track of what I did to get my app to compile and link on qwt. Let me preface this by saying that I don't usually do much development on OSX. I just work through the compiler and linker errors until I get something to work, so there might be a better way (such as compiling as a framework package perhaps), and I might not be putting some of the commands in the 'best' places - I just hack at files until I get things working and move on.
First, I'm using these versions
Apple 10.11.2
Xcode version 7.2 (7C68)
Apple LLVM version 7.0.2 (clang-700.1.81)
Target x86_64-apple-darwin15.2.0
Thread model: posix
Apple 10.11.2
Xcode version 7.2 (7C68)
Apple LLVM version 7.0.2 (clang-700.1.81)
Target x86_64-apple-darwin15.2.0
Thread model: posix
To copy to clipboard, switch view to plain text mode
I modify qwt.pro as follows:
CONFIG += c++11
QMAKE_CXXFLAGS_CXX11 = -std=c++14 -stdlib=libc++
CONFIG += c++11
QMAKE_CXXFLAGS_CXX11 = -std=c++14 -stdlib=libc++
To copy to clipboard, switch view to plain text mode
I modify qwtconfig.pri as follows:
CONFIG += debug_and_release
CONFIG += static
QWT_INSTALL_PLUGINS = $${QWT_INSTALL_PREFIX}/plugins/designer
#QWT_CONFIG += QwtDll
QWT_CONFIG += QwtWidgets
QWT_CONFIG += QwtSvg
#QWT_CONFIG += QwtOpenGL
#QWT_CONFIG += QwtMathML
#QWT_CONFIG += QwtDesigner
#QWT_CONFIG += QwtExamples # commented out to increase the speed of the build when getting build environment working
#QWT_CONFIG += QwtPlayground # commented out to increase the speed of the build when getting build environment working
macx:!static:CONFIG(qt_framework, qt_framework|qt_no_framework) {
# QWT_CONFIG += QwtFramework
}
unix {
#QWT_CONFIG += QwtPkgConfig
}
CONFIG += debug_and_release
CONFIG += static
QWT_INSTALL_PLUGINS = $${QWT_INSTALL_PREFIX}/plugins/designer
#QWT_CONFIG += QwtDll
QWT_CONFIG += QwtPlot
QWT_CONFIG += QwtWidgets
QWT_CONFIG += QwtSvg
#QWT_CONFIG += QwtOpenGL
#QWT_CONFIG += QwtMathML
#QWT_CONFIG += QwtDesigner
#QWT_CONFIG += QwtExamples # commented out to increase the speed of the build when getting build environment working
#QWT_CONFIG += QwtPlayground # commented out to increase the speed of the build when getting build environment working
macx:!static:CONFIG(qt_framework, qt_framework|qt_no_framework) {
# QWT_CONFIG += QwtFramework
}
unix {
#QWT_CONFIG += QwtPkgConfig
}
To copy to clipboard, switch view to plain text mode
Then I build qwt in both Release, and Debug configurations. On windows it will produce both qwt.lib and qwtd.lib with one build because of the debug_and_release flag, but on osx I had to do two separate builds. I copy the build-****/lib/qwt.lib file to the $(QWT_DIR)/lib directory. This is not necessary, I just find this easier to stay organized this way when linking, but you can keep the .lib wherever you want as long as you specify the location properly with the -L linker flag, I use the $QWT_LIB variable defined below. Also note that I had to rename the debug .lib file to qwtd.lib from qwt.lib manually to differentiate it from the release build.
Now, my applications .pro file looks like the following:
QT += core gui
CONFIG += c++11
QT += svg
QMAKE_CXXFLAGS_CXX11 = -std=c++14 -stdlib=libc++
INCLUDEPATH+=$$(QWT_INCLUDE)
debug:LIBS += -L$$(QWT_LIB) -lqwtd
QT += core gui
CONFIG += c++11
QT += svg
QMAKE_CXXFLAGS_CXX11 = -std=c++14 -stdlib=libc++
INCLUDEPATH+=$$(QWT_INCLUDE)
debug:LIBS += -L$$(QWT_LIB) -lqwtd
To copy to clipboard, switch view to plain text mode
I like to use the "Batch Edit" feature to bring in the environment variables. So, for example, for each build configuration/kit go to: Projects->Build Environment->Details->Batch Edit, and add in something like this, modified for the paths on your system of course:
BOOST_INCLUDE=C:\Cpp\boost_1_60_0_msvc12_64\
QWT_INCLUDE=C:\Cpp\qwt-6.1\src
QWT_LIB=C:\Cpp\qwt-6.1\lib32
BOOST_INCLUDE=C:\Cpp\boost_1_60_0_msvc12_64\
QWT_INCLUDE=C:\Cpp\qwt-6.1\src
QWT_LIB=C:\Cpp\qwt-6.1\lib32
To copy to clipboard, switch view to plain text mode
Anyway, that is what I did to do some coding last night. Like I said, I just hack at files until the errors go away, and I might be making it harder for myself by not going with a dynamic library, or not using a framework package, so there might be better ways, and some of the modifications to the above files might not be necessary. I hope this helps. Cheers.
Bookmarks