Hi Richard:
On 2011-06-14 15:25+0100 Richard Jackson wrote:

[...]Looked at the difference between the plplot & qt link options, see
attached,
but there is nothing I can make sense of - the PLplot explicitly
included
many more windows standard dlls, but adding them to qt makes no
difference.
One thing that may be relevant though is that Netbeans & QtCreator both
include qtmain in the link, plplot example does not.

I assume you are comparing compile and link flags with different tool
chains.  I would be interested in a comparison using the same Qt SDK
tool chain. You should be able to obtain the compile and link flags
for qt_example for that tool chain using the method below.

[...]Found this thread
http://www.qtforum.org/article/29890/qt-4-6-linking-problem.html
So that explains why Qt applications will not build with gcc versions other
that 4.4.0

I don't understand all the reasons given in that thread, but in any
case I don't think you should trust anything linking to the Qt
libraries that is not built with the identical tool chain (i.e. the
MinGW one supplied by the Qt SDK since it appears building Qt with a
different tool chain is a tricky business).


But what I still cannot understand is why the Plplot Qt driver will not work
with this same compiler and the Qt libraries linked with this compiler.

Conversely, why does the Plplot build work with a later compiler such as
4.4.4, and the Plplot qt_example work with it when a Netbeans or QtCreator
application does not?

It must be a compile or link flag issue.  I would strip all tool-chain related
packages out of your test environment other than the MinGW-4.4.0 tool
chain that comes with the Qt SDK to eliminate the possibility that you
are accessing an inconsistent version by mistake.  Then make sure you
can compile, link, and run a simple Qt example without PLplot (as your
tests have indicated is possible before).  Record all the compile
flags and link flags used for that build.  Then look at the compile
flags and link flags for the cmake-configured "make VERBOSE=1 -k"
command to build qt_example with the same tool chain.  (The -k option
to make should allow you to build as much as possible despite errors
such as occurs for the simple test done by the simple test-drv-info
test.

Just now I looked at our cmake build-system logic, and it turns out
you can ignore the simple test-drv-info test completely by using the
cmake option -DTEST_DYNDRIVERS=OFF.  (Sorry I did not remember this
before.) So I suggest you try that experiment just in case there is
some linking issue that is exclusive to that simple test that is not
present for qt_example.  (You may still need to use the -k option in
case there are other build issues you want to bypass in order to build
qt_example.) Also, to build qt_example (and its necessary
dependencies) and run it just use the qt_example make target (i.e.,
use "make VERBOSE=1 -k qt_example" to build that application, and the
test_qt_example target (i.e., use "make VERBOSE=1 -k test_qt_example")
to run it.  Note, these targets will not be available unless
you use the -DBUILD_TEST=ON cmake option.

Anyhow, if you can get a cmake-built qt_example to build and run with
the Qt SDK version of the tool chain, then that potentially narrows
down the linking issue to just the test-drv-info case which would
be a big step forward.


I double checked the qt_example.cpp code, it's a straightforward qt
application just like I am trying to build with NetBeans or QtCreator. I
even copied it into Netbeans and QtCreator and then stripped out all the
Plplot references leaving just an empty application and I cannot build it
with either of them with gcc 4.4.4.

It sounds like both the Netbeans and QtCreator build environments will
not work on anything unless you are using the Qt SDK version of the
tool chain.  That's a good constraint in my book since I don't trust
any result with Qt that is built with anything other than the Qt SDK
version of the tool chain.

[...] Thinking some more about it, now that I have built Plplot libraries with 
gcc
4.4.4, would it be possible to link those with a Qt application built with
gcc 4.4.0? Tried it and it works! - I can build a fully featured Qt Plplot
program with 3D graphs, menus, panels, spinboxes etc.

That's a really strange result.  Which tool chain are you using at run
time? I presume your PATH points to one of them but not both.  (And if
both it will just use the first one in the PATH unless there is
something missing from that first tool chain that is resolved by the
second one in your PATH.) Anyhow, I don't trust this result, and it
would be better to figure out why cmake is not generating the correct
compile flags/ linking flags for the Qt SDK version of the tool chain.
I hope the -DTEST_DYNDRIVERS=OFF cmake option (see above) will help
you to figure that out.


Alan, I do intend to try the full MSYS build of the examples for you, but
right now my priority is to get my main application working

Understood.  Such linking issues can usually be solved by something
really simple, but the complicated and time-consuming part is figuring
it out!

Thanks for all your experiments trying to track down what the issue
really is.

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
__________________________

qt_example:



Linking CXX executable qt_example.exe

cd C:\plplot-5.9.7\build\examples\c++ && "C:\Program Files (x86)\CMake 
2.8\bin\cmake.exe" -E cmake_link_script 
CMakeFiles\qt_example.dir\link.txt --verbose=1

"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E remove -f 
CMakeFiles\qt_example.dir/objects.a

C:\gcc4.4\bin\ar.exe cr CMakeFiles\qt_example.dir/objects.a 
@CMakeFiles\qt_example.dir\objects1.rsp

C:\gcc4.4\bin\g++.exe     -Wl,--whole-archive 
CMakeFiles\qt_example.dir/objects.a -Wl,--no-whole-archive  -o 
qt_example.exe -Wl,--out-implib,libqt_example.dll.a 
-Wl,--major-image-version,0,--minor-image-version,0  
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtSvg4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtGui4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtXml4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtCore4.a 
..\..\dll\libplplotqtd.dll.a ..\..\dll\libplplotd.dll.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtSvg4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtGui4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtXml4.a 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\lib\libQtCore4.a 
..\..\dll\libcsirocsa.dll.a ..\..\dll\libqsastime.dll.a -lkernel32 
-luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid 
-lcomdlg32 -ladvapi32 

mingw32-make[2]: Leaving directory `C:/plplot-5.9.7/build'



Netbeans:



g++.exe -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE 
-DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX 
-DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 
-DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN 
-I'c:/QtSDK/Desktop/Qt/4.7.3/mingw/include/QtCore' 
-I'c:/QtSDK/Desktop/Qt/4.7.3/mingw/include/QtGui' 
-I'c:/QtSDK/Desktop/Qt/4.7.3/mingw/include' 
-I'/C/plplot-5.9.7/build/install/include/plplot' 
-I'/C/QtSDK/Desktop/Qt/4.7.3/mingw/include/Qt' 
-I'/C/QtSDK/Desktop/Qt/4.7.3/mingw/include/QtSvg' 
-I'c:/QtSDK/Desktop/Qt/4.7.3/mingw/include/ActiveQt' -I'.' -I'nbproject' 
-I'.' -I'c:/QtSDK/Desktop/Qt/4.7.3/mingw/mkspecs/win32-g++' -o 
build/Debug/MinGW-Windows/csvparser.o csvparser.cpp

windres -i app_resource.rc -o 
build/Debug/MinGW-Windows/app_resource_res.o --include-dir=. -DUNICODE 
-DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX 
-DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 
-DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN

g++ -enable-stdcall-fixup -Wl,-enable-auto-import 
-Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o 
dist/Debug/MinGW-Windows/app.exe build/Debug/MinGW-Windows/main.o 
build/Debug/MinGW-Windows/csvparser.o  
-L'c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib' -lmingw32 -lqtmaind 
build/Debug/MinGW-Windows/app_resource_res.o 
C:/plplot-5.9.7/build/install/lib/libcsirocsa.dll.a 
C:/plplot-5.9.7/build/install/lib/libplplotcxxd.dll.a 
C:/plplot-5.9.7/build/install/lib/libplplotd.dll.a 
C:/plplot-5.9.7/build/install/lib/libplplotqtd.dll.a 
C:/plplot-5.9.7/build/install/lib/libqsastime.dll.a -lQtGuid4 -lQtCored4 
-LC:\OpenSSL-Win32_full\lib 

c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o): In 
function `WinMain@16':

c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:93: undefined 
reference to `_Unwind_Resume'

c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:135: undefined 
reference to `_Unwind_Resume'

c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):c:\\ndk_bu
ilddirectory\\Qt\\4.7\\desktop_mingw\\src\\winmain/../../include/QtCore/.
./../../../../../ndk_buildrepos/qt-desktop/src/corelib/tools/qvector.h:48
4: undefined reference to `_Unwind_Resume'

c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):c:\\ndk_bu
ilddirectory\\Qt\\4.7\\desktop_mingw\\src\\winmain/../../include/QtCore/.
./../../../../../ndk_buildrepos/qt-desktop/src/corelib/tools/qvector.h:48
5: undefined reference to `_Unwind_Resume'

c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):qtmain_win
.cpp:(.eh_frame+0x12): undefined reference to 
`__gxx_personality_v0make[2]: Leaving directory 
`D:/Data/NetBeansProjects/app'

make[1]: Leaving directory `D:/Data/NetBeansProjects/app'

'

collect2: ld returned 1 exit status

make[2]: *** [dist/Debug/MinGW-Windows/app.exe] Error 1

make[1]: *** [.build-conf] Error 2

make: *** [.build-impl] Error 2







------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to