On Sat, Aug 18, 2012 at 06:09:13PM -0700, Jerry wrote:
> 
> On Aug 18, 2012, at 1:37 PM, Andrew Ross wrote:
> 
> >> P.S.  That comment wasn't quite right.  To further clarify, all lists
> >> of linking flags like QT_LIBRARIES are further processed by our build
> >> system when they are first encountered (in cmake/modules) to transform
> >> -L and -l options to construct the equivalent full path name of
> >> libraries without disturbing other linking flags. (The absolute
> >> pathname form is the preferred one for variables that are used in
> >> target_link_libraries even though CMake internally changes that back
> >> to the -L and -l form when linking Linux libraries.  But the actual
> >> resulting linking command may be different on other platforms which is
> >> why the absolute pathname form for library locations is preferred for
> >> input to target_link_libraries.)
> >> 
> >> In sum, that clarification means for the case where you need to drop
> >> some but not all of those libraries, you should parse lists of linking
> >> flags such as QT_LIBRARIES to drop all absolute pathames other than
> >> the libraries you want. That parsing should leave hyphenated options
> >> alone.
> > 
> > I've now done this, parsing QT_LIBRARIES to extract just the QtCore 
> > library. Jerry, can you try this version? Out of interest, if it 
> > doesn't work can you report the values of QT_LIBRARIES and QT_LINK_LIBS
> > returned by cmake, and also the actual command used to link the Qt driver?
> > 
> > Thanks
> > 
> > Andrew
> 
> 
> Andrew,
> 
> Sorry. With -DNON_TRANSITIVE=ON, the build failed on SVN 12217. The variables 
> you wanted to see are:
> 
> QT_LIBRARIES = 
> /opt/local/lib/libQtSvg.dylib;/opt/local/lib/libQtGui.dylib;/opt/local/lib/libQtXml.dylib;/opt/local/lib/libQtCore.dylib
> QT_LINK_LIBS = /opt/local/lib/libQtCore.dylib
> 
> Here is the error output and the few lines before it. Does this contain the 
> link command you need to see?
> 
> Scanning dependencies of target qt
> make -f drivers/CMakeFiles/qt.dir/build.make drivers/CMakeFiles/qt.dir/build
> /opt/local/bin/cmake -E cmake_progress_report 
> /usr/local/plplot_build_dir/CMakeFiles 42
> [ 31%] Building CXX object drivers/CMakeFiles/qt.dir/qt.cpp.o
> cd /usr/local/plplot_build_dir/drivers && 
> /usr/local/adacore-gnat-2011/bin/c++   -Dqt_EXPORTS -DHAVE_CONFIG_H -fPIC 
> -I/Users/jerrybauck/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/include
>  
> -I/Users/jerrybauck/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/lib/qsastime
>  
> -I/Users/jerrybauck/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/lib/nistcd
>  -I/usr/local/plplot_build_dir -I/usr/local/plplot_build_dir/include     
> -I/opt/local/include/QtDesigner -I/opt/local/include/QtDeclarative 
> -I/opt/local/include/QtScriptTools -I/opt/local/include/QtDBus 
> -I/opt/local/include/QtDesigner -I/opt/local/include/QtXml 
> -I/opt/local/include/QtSql -I/opt/local/include/QtOpenGL 
> -I/opt/local/include/QtMultimedia -I/opt/local/include/QtNetwork 
> -I/opt/local/include/QtXmlPatterns -I/opt/local/include/QtWebKit 
> -I/opt/local/include/QtHelp -I/opt/local/include/QtUiTools 
> -I/opt/local/include/QtTest -I/opt/local/include/QtScript 
> -I/opt/local/include/QtSvg -I/opt/local/include/Qt3Support -I/op
> t/local/include/QtGui -I/opt/local/include/QtCore 
> -I/opt/local/share/qt4/mkspecs/default -I/opt/local/include 
> -I/opt/local/include/QtCore -DUSINGDLL -o CMakeFiles/qt.dir/qt.cpp.o -c 
> /Users/jerrybauck/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_svn/plplot/drivers/qt.cpp
> Linking CXX shared module qt.so
> cd /usr/local/plplot_build_dir/drivers && /opt/local/bin/cmake -E 
> cmake_link_script CMakeFiles/qt.dir/link.txt --verbose=1
> /usr/local/adacore-gnat-2011/bin/c++   -bundle 
> -Wl,-headerpad_max_install_names   -o qt.so CMakeFiles/qt.dir/qt.cpp.o 
> ../src/libplplotd.11.0.0.dylib /usr/lib/libm.dylib 
> ../bindings/qt_gui/libplplotqtd.0.0.1.dylib ../src/libplplotd.11.0.0.dylib 
> /opt/local/lib/libQtCore.dylib 
> Undefined symbols for architecture x86_64:
>  "QWidget::move(QPoint const&)", referenced from:
>      QWidget::move(int, int) in qt.cpp.o
>  "QWidget::resize(QSize const&)", referenced from:
>      QWidget::resize(int, int) in qt.cpp.o
>  "QApplication::QApplication(int&, char**, bool, int)", referenced from:
>      initQtApp(bool) in qt.cpp.o
>  "QSvgGenerator::size() const", referenced from:
>      plD_eop_svgqt(PLStream*)     in qt.cpp.o
>  "QPicture::QPicture(int)", referenced from:
>      plD_init_qtwidget(PLStream*)     in qt.cpp.o
>      plD_init_extqt(PLStream*)     in qt.cpp.o
>  "QPainter::QPainter(QPaintDevice*)", referenced from:
>      plD_init_qtwidget(PLStream*)     in qt.cpp.o
>      plD_init_extqt(PLStream*)     in qt.cpp.o
>  "QWidget::setWindowTitle(QString const&)", referenced from:
>      plD_init_qtwidget(PLStream*)     in qt.cpp.o
>  "QPainter::~QPainter()", referenced from:
>      plD_init_qtwidget(PLStream*)     in qt.cpp.o
>      plD_init_extqt(PLStream*)     in qt.cpp.o
>  "QPicture::~QPicture()", referenced from:
>      plD_init_qtwidget(PLStream*)     in qt.cpp.o
>      plD_init_extqt(PLStream*)     in qt.cpp.o
>  "QWidget::raise()", referenced from:
>      plD_eop_qtwidget(PLStream*)     in qt.cpp.o
>  "QImage::scanLine(int)", referenced from:
>      plD_init_memqt(PLStream*)     in qt.cpp.o
>      plD_eop_memqt(PLStream*)     in qt.cpp.o
> ld: symbol(s) not found for architecture x86_64
> collect2: ld returned 1 exit status
> make[2]: *** [drivers/qt.so] Error 1
> make[1]: *** [drivers/CMakeFiles/qt.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> 
> With With -DNON_TRANSITIVE=OFF, the variables QT_LIBRARIES and do not appear 
> in the cmake output, and the build succeeds.

Jerry,

Thanks. So my method did what it was meant to, but unforunately it looks 
like we need to actually link in QtGui and QtSvg as well, so we might
as well just use QT_LIBRARIES without trying to parse it. 

Note that QtCore has to be explicitly linked in since qt.cpp references
QApplication. 

Classes from QtGui and QtSvg are not explictly mentioned in qt.cpp, but 
derived classes (QtPLWidget etc from plplotqtd) are mentioned. On Linux
at least "ldd -u qt.so" shows these libraries as unused dependencies, but
"nm --demangle --undefined-only qt.so" contains references to functions
in these libraries. I don't quite understand why, but I think to be safe
we need to link with them, even if it causes warnings about linking
with unused dependencies.

Andrew 

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to