digitalmars.D.learn - Linking problem with QtD
- Qian Xu (24/24) Oct 29 2009 Hi All,
- Eldar Insafutdinov (5/35) Oct 29 2009 Hi!
- albatroz (9/58) Oct 29 2009 Hello,
- Qian Xu (5/70) Oct 29 2009 I am considering two possible reasons:
- Eldar Insafutdinov (2/75) Oct 29 2009 All Qt versions keep forward binary compatibility and a full compatibili...
- Qian Xu (7/13) Oct 30 2009 The problem has been solve.
- Eldar Insafutdinov (2/19) Oct 30 2009 You are welcome. I'm glad you solved the problem. Yes, I should've guess...
- Qian Xu (3/8) Oct 30 2009 Because the demo project uses QApplication and QMainWindow, which belong...
- Eldar Insafutdinov (2/11) Oct 30 2009 Yes it does. Can you post the exact command line that you use when build...
Hi All, I have almost built the first demo, but ... The components I have are as follows: 1. QtK SDK (LGPL edition) 4.5.3 2. the latest svn version of QtD (trunk-r309.zip) 3. DMD 1.050 4. Tango (current from trunk) 5. Platform: openSUSE 11.1. 6. cmake 2.6 After QtD was built successfully, I try to compile the demo (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy) I got many linking errors: [code]../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_setOption_PrintDialogOption_bool': QPrintDialog_shell.cpp:(.text+0x20b): undefined reference to `QPrintDialog::setOption(QAbstractPrintDialog::PrintDialogOption, bool)' ../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_options': QPrintDialog_shell.cpp:(.text+0x22b): undefined reference to `QPrintDialog::options() const'[/code] There are many undefined references. I checked the source and the '.a' files. These functions are defined correctly. Have I still forget something by linking the demo or building the library? Any hint is welcome
Oct 29 2009
Qian Xu Wrote:Hi All, I have almost built the first demo, but ... The components I have are as follows: 1. QtK SDK (LGPL edition) 4.5.3 2. the latest svn version of QtD (trunk-r309.zip) 3. DMD 1.050 4. Tango (current from trunk) 5. Platform: openSUSE 11.1. 6. cmake 2.6 After QtD was built successfully, I try to compile the demo (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy) I got many linking errors: [code]../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_setOption_PrintDialogOption_bool': QPrintDialog_shell.cpp:(.text+0x20b): undefined reference to `QPrintDialog::setOption(QAbstractPrintDialog::PrintDialogOption, bool)' ../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_options': QPrintDialog_shell.cpp:(.text+0x22b): undefined reference to `QPrintDialog::options() const'[/code] There are many undefined references. I checked the source and the '.a' files. These functions are defined correctly. Have I still forget something by linking the demo or building the library? Any hint is welcomeHi! Undefined symbols that are missing are from Qt libs. I'd recommend to do 'make install' after you build QtD (don't forget to specify CMAKE_INSTALL_PREFIX option in cmake prior to build to point to the directory where you have your dmd toolchain) and then look into the build scripts of the examples which typically have a name build.sh. They contain the command line with all necessary libraries to link, typically: -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.
Oct 29 2009
Eldar Insafutdinov wrote:Qian Xu Wrote:[code]../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o):Hi All, I have almost built the first demo, but ... The components I have are as follows: 1. QtK SDK (LGPL edition) 4.5.3 2. the latest svn version of QtD (trunk-r309.zip) 3. DMD 1.050 4. Tango (current from trunk) 5. Platform: openSUSE 11.1. 6. cmake 2.6 After QtD was built successfully, I try to compile the demo (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy) I got many linking errors:Hello, I decided not to install it globally, first export to ldd the path to your QT lib folder export LIBRARY_PATH=/usr/lib64/qt4/ and build the examples using the complete path of libQtGui -L/usr/lib64/qt4/libQtGui.so -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui This allows me to have several folders with different versions.In function `qtd_QPrintDialog_setOption_PrintDialogOption_bool': QPrintDialog_shell.cpp:(.text+0x20b): undefined reference to `QPrintDialog::setOption(QAbstractPrintDialog::PrintDialogOption, bool)' ../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_options': QPrintDialog_shell.cpp:(.text+0x22b): undefined reference to `QPrintDialog::options() const'[/code] There are many undefined references. I checked the source and the '.a' files. These functions are defined correctly. Have I still forget something by linking the demo or building the library? Any hint is welcomeHi! Undefined symbols that are missing are from Qt libs. I'd recommend to do 'make install' after you build QtD (don't forget to specify CMAKE_INSTALL_PREFIX option in cmake prior to build to point to the directory where you have your dmd toolchain) and then look into the build scripts of the examples which typically have a name build.sh. They contain the command line with all necessary libraries to link, typically: -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.
Oct 29 2009
albatroz Wrote:Eldar Insafutdinov wrote:I am considering two possible reasons: 1. I linked to a wrong Qt-library 2. The QtD is not compatible with Qt 4.5.3 (I Saw the build package uses Qt 4.5.2, maybe those undefined references comes from Qt 4.5.3) I have also downloaded a pre-compiled QtD library from code.google.com, it works. I can compile Hello world programs. However, this version does not contain all classes as the library I was trying to build. If later I find that some important classes are missing, it will be a big problem for choosing QtD.Qian Xu Wrote:[code]../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o):Hi All, I have almost built the first demo, but ... The components I have are as follows: 1. QtK SDK (LGPL edition) 4.5.3 2. the latest svn version of QtD (trunk-r309.zip) 3. DMD 1.050 4. Tango (current from trunk) 5. Platform: openSUSE 11.1. 6. cmake 2.6 After QtD was built successfully, I try to compile the demo (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy) I got many linking errors:Hello, I decided not to install it globally, first export to ldd the path to your QT lib folder export LIBRARY_PATH=/usr/lib64/qt4/ and build the examples using the complete path of libQtGui -L/usr/lib64/qt4/libQtGui.so -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui This allows me to have several folders with different versions.In function `qtd_QPrintDialog_setOption_PrintDialogOption_bool': QPrintDialog_shell.cpp:(.text+0x20b): undefined reference to `QPrintDialog::setOption(QAbstractPrintDialog::PrintDialogOption, bool)' ../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_options': QPrintDialog_shell.cpp:(.text+0x22b): undefined reference to `QPrintDialog::options() const'[/code] There are many undefined references. I checked the source and the '.a' files. These functions are defined correctly. Have I still forget something by linking the demo or building the library? Any hint is welcomeHi! Undefined symbols that are missing are from Qt libs. I'd recommend to do 'make install' after you build QtD (don't forget to specify CMAKE_INSTALL_PREFIX option in cmake prior to build to point to the directory where you have your dmd toolchain) and then look into the build scripts of the examples which typically have a name build.sh. They contain the command line with all necessary libraries to link, typically: -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.
Oct 29 2009
Qian Xu Wrote:albatroz Wrote:All Qt versions keep forward binary compatibility and a full compatibility within a major version, 4.5.3 contains only bug fixes compared to 4.5.2. Version from code.google.com is a waaaaay to old, so I would not even consider it. Have you tried to turn on BUILD_EXAMPLES option in cmake? It will build all examples bundled with qtd.Eldar Insafutdinov wrote:I am considering two possible reasons: 1. I linked to a wrong Qt-library 2. The QtD is not compatible with Qt 4.5.3 (I Saw the build package uses Qt 4.5.2, maybe those undefined references comes from Qt 4.5.3) I have also downloaded a pre-compiled QtD library from code.google.com, it works. I can compile Hello world programs. However, this version does not contain all classes as the library I was trying to build. If later I find that some important classes are missing, it will be a big problem for choosing QtD.Qian Xu Wrote:[code]../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o):Hi All, I have almost built the first demo, but ... The components I have are as follows: 1. QtK SDK (LGPL edition) 4.5.3 2. the latest svn version of QtD (trunk-r309.zip) 3. DMD 1.050 4. Tango (current from trunk) 5. Platform: openSUSE 11.1. 6. cmake 2.6 After QtD was built successfully, I try to compile the demo (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy) I got many linking errors:Hello, I decided not to install it globally, first export to ldd the path to your QT lib folder export LIBRARY_PATH=/usr/lib64/qt4/ and build the examples using the complete path of libQtGui -L/usr/lib64/qt4/libQtGui.so -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui This allows me to have several folders with different versions.In function `qtd_QPrintDialog_setOption_PrintDialogOption_bool': QPrintDialog_shell.cpp:(.text+0x20b): undefined reference to `QPrintDialog::setOption(QAbstractPrintDialog::PrintDialogOption, bool)' ../../../../build_dir/build/lib/libqtdgui.a(QPrintDialog_shell.cpp.o): In function `qtd_QPrintDialog_options': QPrintDialog_shell.cpp:(.text+0x22b): undefined reference to `QPrintDialog::options() const'[/code] There are many undefined references. I checked the source and the '.a' files. These functions are defined correctly. Have I still forget something by linking the demo or building the library? Any hint is welcomeHi! Undefined symbols that are missing are from Qt libs. I'd recommend to do 'make install' after you build QtD (don't forget to specify CMAKE_INSTALL_PREFIX option in cmake prior to build to point to the directory where you have your dmd toolchain) and then look into the build scripts of the examples which typically have a name build.sh. They contain the command line with all necessary libraries to link, typically: -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.
Oct 29 2009
Eldar Insafutdinov wrote:All Qt versions keep forward binary compatibility and a full compatibility within a major version, 4.5.3 contains only bug fixes compared to 4.5.2. Version from code.google.com is a waaaaay to old, so I would not even consider it. Have you tried to turn on BUILD_EXAMPLES option in cmake? It will build all examples bundled with qtd.The problem has been solve. The linker "ld" searches first in "/usr/lib" (Qt 4.4.3) and then my "/my-qt-sdk/lib", even when the path "/usr/lib" is not specified. I checked the man page of "ld". There is an argument "-rpath-link". If it is not specified, the "/usr/lib" will be assumed. So my problem is solve. Thanks for you all. Have a nice day.
Oct 30 2009
Qian Xu Wrote:Eldar Insafutdinov wrote:You are welcome. I'm glad you solved the problem. Yes, I should've guessed an issue, since it was missing symbols from Qt 4.5, on which QtD is based on. And it worked with version from google-code, because it was using Qt 4.4.All Qt versions keep forward binary compatibility and a full compatibility within a major version, 4.5.3 contains only bug fixes compared to 4.5.2. Version from code.google.com is a waaaaay to old, so I would not even consider it. Have you tried to turn on BUILD_EXAMPLES option in cmake? It will build all examples bundled with qtd.The problem has been solve. The linker "ld" searches first in "/usr/lib" (Qt 4.4.3) and then my "/my-qt-sdk/lib", even when the path "/usr/lib" is not specified. I checked the man page of "ld". There is an argument "-rpath-link". If it is not specified, the "/usr/lib" will be assumed. So my problem is solve. Thanks for you all. Have a nice day.
Oct 30 2009
Eldar Insafutdinov wrote:I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.Because the demo project uses QApplication and QMainWindow, which belong to libQtGui.
Oct 30 2009
Qian Xu Wrote:Eldar Insafutdinov wrote:Yes it does. Can you post the exact command line that you use when building an example?I saw you made the reference to this link (http://www.dsource.org/projects/qtd/wiki/MacCaseStudy which contains this command line option, but still I don't understand why you get undefined symbols like QPrintDialog::options() const which belongs to libQtGui.Because the demo project uses QApplication and QMainWindow, which belong to libQtGui.
Oct 30 2009