On 2009-05-03 05:01-0700 Alan W. Irwin wrote:

> II. -DENABLE_DYNDRIVERS=OFF case
>
> [...]I ran into missing symbol errors when building c++/qt_example in the
> installed examples. The symbols that are missing are in libplotd, but just
> not visible.  I have been unable to figure out this visibility issue [...]

Following up on this problem with a new subject line, here is the
complete build message error.

/usr/bin/g++ qt_example.cpp qt_PlotWindow.cpp moc_qt_PlotWindow.cpp -o 
qt_example -Wl,-rpath 
-Wl,/home/software/plplot_cvs/installcmake/lib:/home/software/qtsdk-2009.02/qt/lib:/home/software/lasi_svn/install/lib
 `PKG_CONFIG_PATH=/home/software/plplot_cvs/installcmake/lib/pkgconfig 
pkg-config --cflags --libs plplotd-qt`
/tmp/cciaP0Xm.o: In function `PlotWindow::interactive()':
qt_PlotWindow.cpp:(.text+0x7b): undefined reference to 
`QtExtWidget::captureMousePlotCoords(double*, double*)'
/tmp/cciaP0Xm.o: In function `PlotWindow::plotHistogram()':
qt_PlotWindow.cpp:(.text+0x259): undefined reference to 
`QtPLWidget::clearWidget()'
/tmp/cciaP0Xm.o: In function `PlotWindow::plotCurves()':
qt_PlotWindow.cpp:(.text+0x51e): undefined reference to 
`QtPLWidget::clearWidget()'
/tmp/cciaP0Xm.o: In function `PlotWindow::~PlotWindow()':
qt_PlotWindow.cpp:(.text+0x944): undefined reference to `plfreeqtdev()'
/tmp/cciaP0Xm.o: In function `PlotWindow::~PlotWindow()':
qt_PlotWindow.cpp:(.text+0x9ec): undefined reference to `plfreeqtdev()'
/tmp/cciaP0Xm.o: In function `PlotWindow::~PlotWindow()':
qt_PlotWindow.cpp:(.text+0xa8e): undefined reference to `plfreeqtdev()'
/tmp/cciaP0Xm.o: In function `PlotWindow::PlotWindow(QWidget*)':
qt_PlotWindow.cpp:(.text+0xfae): undefined reference to 
`QtExtWidget::QtExtWidget(int, int, QWidget*)'
qt_PlotWindow.cpp:(.text+0x1041): undefined reference to 
`plsetqtdev(QtExtWidget*)'
/tmp/cciaP0Xm.o: In function `PlotWindow::PlotWindow(QWidget*)':
qt_PlotWindow.cpp:(.text+0x1566): undefined reference to 
`QtExtWidget::QtExtWidget(int, int, QWidget*)'
qt_PlotWindow.cpp:(.text+0x15f9): undefined reference to 
`plsetqtdev(QtExtWidget*)'
collect2: ld returned 1 exit status

For -DENABLE_DYNDRIVERS=OFF, I looked at the symbols in libplplotd using nm, 
and, e.g., plfreeqtdev
is defined but not visible (external).  Yet in qt.h,
plfreeqtdev is declared using PLDLLIMPEXP_DRIVER.  That does make that symbol
visible in qt.so for the -DENABLE_DYNDRIVERS=ON case.  For the
-DENABLE_DYNDRIVERS=OFF case logic in include/pldll.h should just treat
PLDLLIMPEXP_DRIVER the same as PLDLLIMPEXP (just like you want
since the qt code is in libplplot.so for that case) which should make
plfreeqtdev visible in libplotd for -DENABLE_DYNDRIVERS=OFF.  But that logic
doesn't seem to work for reasons which escape me.

Note, I think this is the first time that special stanza in pldll.h for
the -DENABLE_DYNDRIVERS=OFF case has actually made a practical difference
since all the rest of the PLDLLIMPEXP_DRIVER use is for symbols needed
by the driver infrastructure code in libplplotd, and the matter of external
visibility doesn't matter in that case because the required symbols are
part of the library.  Therefore, if there is something wrong with that
stanza, this is the first time we would know about it.  However, it's really
simple logic to treat PLDLLIMPEXP_DRIVER the same as PLDLLIMPEXP, and I
cannot see anything wrong with it.

How can I debug this thicket of #ifdef's etc., to find whether my mental
model of the pldll.h logic is deviating from reality?

I am beginning to wonder if this visibility issue is because
-DENABLE_DYNDRIVERS=OFF mixes the C++ qt code in with the C code of
the PLplot core, and there is some name mangling issue that is not being
taken care of in that case?  I think everything should be fine for
mixed C and C++ code in a library if all compilation and linking is done
with g++, but I should double-check that.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to