Paraview Plugin based on Qt fails to link on Mac OS OX (10.6.8 Snow | gcc 4.2.1 | Qt 4.7 | CMake 2.8-2 | x86_64 is on)
-
Hi,
i am working on a Paraview (Kitware) Plugin that adds a new Qt progress bar type
to the standard ParaView toolbar. I try to build the plugin as a stand-alone, that is
not included in Paraview build but out of source. Note that the plugin builds and works
fine on linux x86_64 (load/unload at runtime).I 've included /Developer/Tools/Qt to my PATH for Qt/Paraview binaries and included the
libraries i need in LD_LIBRARY_PATH | DYLD_LIBRARY_PATH (LIBRARY_PATH is
blank, not sure if i have to care about this). While trying to link the plug-in i get:Linking CXX shared library libZeo.dylib
Undefined symbols for architecture x86_64:
"typeinfo for pqPVAnimationWidget", referenced from:
pqZeo::GetTimeSteps() in pqZeo.cpp.o
ld: symbol(s) not found for architecture x86_64The first idea (although irrelevant i am afraid) is to configure the CMakeCache file
//Build architectures for OSX
CMAKE_OSX_ARCHITECTURES:STRING=x86_64I installed the Qt 4.7 SDK.mpkg bundle a while ago, qmake query outputs:
QT_INSTALL_PREFIX:/
QT_INSTALL_DATA:/usr/local/Qt4.7
QT_INSTALL_DOCS:/Developer/Documentation/Qt
QT_INSTALL_HEADERS:/usr/include
QT_INSTALL_LIBS:/Library/Frameworks
QT_INSTALL_BINS:/Developer/Tools/Qt
QT_INSTALL_PLUGINS:/Developer/Applications/Qt/plugins
QT_INSTALL_IMPORTS:/Developer/Applications/Qt/imports
QT_INSTALL_TRANSLATIONS:/Developer/Applications/Qt/translations
QT_INSTALL_CONFIGURATION:/Library/Preferences/Qt
QT_INSTALL_EXAMPLES:/Developer/Examples/Qt/
QT_INSTALL_DEMOS:/Developer/Examples/Qt/Demos
QMAKE_MKSPECS:/usr/local/Qt4.7/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.7.0Is there any issue with my Qt installation? Do you think that i should update my Qt
to Qt SDK version 1.1.3 and try to build Paraview and all binaries/libs with Xcode 4.0
instead of makefiles?Let me know if you have any other hints, cheers
N
-
pqPVAnimationWidget is related to ParaView, but i believe that
QList<double> pqZeo::GetTimeSteps() {...}
makes it relevant to mention the issue here -
proceeding with Qt 4.7.4 and building from scratch. will update soonish
-
Problem persists even with Qt 4.7.4: My plugin builds OK if i choose a static library, but of course i cannot load it into PV. Can anyone decipher the message below when i choose to build a shared lib, that is *.dylib? (Paraview 3.10.1 using Qt 4.7.4 on Mac OS OX 10.6.8 | gcc 4.2.1 | CMake 2.8-2)
Thanks
Linking CXX shared library libZ.dylib
Undefined symbols for architecture x86_64:
"typeinfo for pqPVAnimationWidget", referenced from:
pqZ::GetTimeSteps() in pqZ.cpp.o
ld: symbol(s) not found for architecture x86_64N
-
Looks like something is not built with the proper architectures, so some symbols are missing. You must adjust the settings of your plugin to the settings of the Qt and ParaView builds.
-
i built the plugin with a simple makefile. What confuses me is the successful build of the plugin as a static lib and the failure of a shared lib.. My configuration for these two cases is the same..
-
I would recommend using a .pro file and qmake for building your pluging.
Anyways, make sure you add the following switches to the command line arguments of your C/C++ compiler and the linker:
@
-arch x86_64 -arch i386
@This will build 32bit and 64bit code for intel processors. You might want to add other archs as well (ppc, ppc64) if needed.
-
thanks Volker. is there any automatic script for converting my CMakeLists.txt of the plugin to a .pro file
(something more advanced than qmake -project)? or the converse of this report
http://developer.qt.nokia.com/quarterly/view/using_cmake_to_build_qt_projects ?
i guess Cmake works better for building Paraview (same family), but for Qt plug-ins i should use Qmake.. -
as for the arch flags, they are there in both Xcode and command line
-
qmake -project outputs a src_qmake.pbproj file that i rename to src_qmake.xcodeproj. Is this the expected behavior? I cannot launch src_qmake.xcodeproj, it complains about incompatible project version.
thanks
N
-
"qmake -project" usually outputs a xyz.pro file (with xyz being the directory name you're in).
If you want an XCode project generated out of the .pro file, you need to issue:
@
qmake -spec macx-xcode
@ -
thanks volker, i was going with qmake -spec macx-g++ and was expecting an xcode project
-
qmake -spec macx-g++ generates a regular Makefile. You can build it with make.
-
I was too fast in replying..
qmake -project and then qmake -spec macx-xcode outputs src_qmake.pbproj that i rename to src_qmake.xcodeproj. as i 've written earlier on, this is not loaded in Xcode.. -
something is seriously going wrong there.
@
qmake -spec macx-xcode
@should create a directory named src_qmake.xcodeproj, which in turn contains a file named project.pbxproj.
-
OK, sth is wrong indeed. in a hello directory consisting of hello.cpp and hello.pro i go with
@qmake -spec macx-g++@ and the little gui (hello.app) builds fine, whereas with
@qmake -spec macx-xcode@ i get a hello.pbproj and the related plist without any Xcode directory.
i 'll build qt from scratch, thanks