View previous topic :: View next topic |
Author |
Message |
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Jun 16, 2010 9:31 am Post subject: Doesn't build on QT 4.7 Beta. |
|
|
I'm trying to build QtD on KDE SC 4.5 Beta and DMD 2.047, but it fails:
Quote: |
/home/mitu/Pulpit/qtd/build_dir/build/cpp/qt_core/QMetaType_shell.cpp:12: error: ‘VoidFunc’ has not been declared
/home/mitu/Pulpit/qtd/build_dir/build/cpp/qt_core/QMetaType_shell.cpp:12: error: ‘VoidFunc’ has not been declared
/home/mitu/Pulpit/qtd/build_dir/build/cpp/qt_core/QMetaType_shell.cpp:17: error: ‘VoidFunc’ has not been declared
/home/mitu/Pulpit/qtd/build_dir/build/cpp/qt_core/QMetaType_shell.cpp:18: error: ‘VoidFunc’ has not been declared
make[5]: *** [CMakeFiles/cpp_core.dir/cpp/qt_core/QMetaType_shell.cpp.o] Błąd 1
make[4]: *** [CMakeFiles/cpp_core.dir/all] Błąd 2
make[3]: *** [all] Błąd 2
make[2]: *** [main] Błąd 2
make[1]: *** [CMakeFiles/main.dir/all] Błąd 2
make: *** [all] Błąd 2
|
|
|
Back to top |
|
|
maxter
Joined: 17 May 2006 Posts: 34
|
Posted: Wed Jun 23, 2010 12:41 pm Post subject: |
|
|
Updated to dmd.2.047 and fixed that VoidFunc error. The thing seems to work but I will be able to test it only tomorrow. |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Jun 23, 2010 2:26 pm Post subject: |
|
|
Built now, but when trying to compile an example:
Compiler wrote: | /usr/local/include/d/qt/gui/QApplication.di(13): Error: module Traits is in file 'qtd/Traits.d' which cannot be read
import path[0] = ../../../
import path[1] = ../../../qt/d2
import path[2] = /usr/include/d/dmd/phobos
import path[3] = /usr/include/d/dmd/druntime/import
import path[4] = /usr/include/d/gtkd
import path[5] = /usr/local/include/d |
|
|
Back to top |
|
|
SgtMuffles
Joined: 30 Dec 2007 Posts: 1
|
|
Back to top |
|
|
maxter
Joined: 17 May 2006 Posts: 34
|
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Tue Jul 13, 2010 11:51 am Post subject: |
|
|
OK. Library built. I've written a simple program. It compiles, but does not link - I get a huge output consisting of these:
dmd wrote: |
/usr/local/lib/libqtdcore.a(qtdcore0.o): In function `_D2qt4core11QChildEvent11QChildEvent6__ctorMFE2qt4core6QEvent6QEvent4TypeC2qt4core7QObject7QObjectZC2qt4core11QChildEvent11QChildEvent':
/home/mitu/Pulpit/qtd/d2/qtd/util/Tuple.d.text._D2qt4core11QChildEvent11QChildEvent6__ctorMFE2qt4core6QEvent6QEvent4TypeC2qt4core7QObject7QObjectZC2qt4core11QChildEvent11QChildEvent+0x1d): undefined reference to `qtd_QChildEvent_QChildEvent_Type_QObject' |
"/home/mitu/Pulpit/qtd" is a directory where I had downloaded sources before I compiled and installed them. I've already removed it and it is still shown in the errors... |
|
Back to top |
|
|
eldar
Joined: 14 Jun 2008 Posts: 101 Location: Ufa, Russia
|
Posted: Tue Jul 13, 2010 1:42 pm Post subject: |
|
|
Can you post the exact command that you use for building the example?
It should be something like
dmd main.d -L-lqtdgui -L-lqtdcore -L-lcpp_gui -L-lcpp_core -L-lQtGui -L-lQtCore |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Jul 14, 2010 4:33 am Post subject: |
|
|
Compiled, but running gives this:
./hello: error while loading shared libraries: libcpp_gui.so: cannot open shared object file: No such file or directory
despite it is present in /usr/local/lib...
EDIT:
Tried a few possibilities, but nothing works :/
What flags do I need to put in /etc/dmd.conf in order to compile programs just with "dmd main.d" even if it uses qtdwebkit, qtdopengl etc.?
EDIT down:
You've post it probably while I was editing my post - I'll try it, but please answer my question also
Last edited by Mitu on Wed Jul 14, 2010 4:56 am; edited 2 times in total |
|
Back to top |
|
|
eldar
Joined: 14 Jun 2008 Posts: 101 Location: Ufa, Russia
|
Posted: Wed Jul 14, 2010 4:43 am Post subject: |
|
|
It usually happens that it doesn't see libraries from /usr/local/lib . Try to restart your terminal and also check the LD_LIBRARY_PATH environment library, /usr/local/lib should be on it. |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Jul 14, 2010 6:29 am Post subject: |
|
|
Yes, it was empty. I've set it using export, but how to store it permanently?
After setting it works, but when I tried to use some oter modules (XML, WebKit, Network etc.), then it doesn't work.
Flags in /etc/dmd.conf:
-I/usr/local/include/d -L-lqtdcore -L-lqtdgui -L-lqtdopengl -L-lqtdnetwork -L-lqtdsvg -L-lqtdxml -L-lqtdwebkit -L-lQtCore -L-lQtGui -L-lQtOpenGL -L-lQtNetwork -L-lQtSvg -L-lQtXml -L-lQtWebKit -L-lcpp_core -L-lcpp_gui -L-lcpp_webkit -L-lcpp_svg -L-lcpp_network -L-lcpp_opengl -L-lcpp_xml
Result: lots of similar to this:
Code: | /usr/local/lib/libcpp_xml.so: undefined reference to `qtd_QXmlLexicalHandler_errorString_const_dispatch'
/usr/local/lib/libcpp_opengl.so: undefined reference to `qtd_QGLWidget_glInit_dispatch'
collect2: ld returned 1 exit status
--- errorlevel 1 |
|
|
Back to top |
|
|
maxter
Joined: 17 May 2006 Posts: 34
|
Posted: Wed Jul 14, 2010 9:18 am Post subject: |
|
|
You are linking against libcpp_*.so libs corresponding to Qt modules not used in your program. Consequently, the dynamic linker cannot resolve functions referenced by SOs but not present in the host executable. Try to remove the unused ones. This is a temporary limitation that we hope to fix asap. |
|
Back to top |
|
|
eldar
Joined: 14 Jun 2008 Posts: 101 Location: Ufa, Russia
|
Posted: Wed Jul 14, 2010 11:53 am Post subject: |
|
|
Also it's not a good practice to put all possible libraries to link into the dmd.conf. This file should only contain implicit linking to the runtime and the standard library, not any other 3rd party libraries. All the linking business should be a part of particular project build system.
EDIT: of course this doesn't apply if you are using a local dmd.conf. |
|
Back to top |
|
|
Mitu
Joined: 22 Sep 2009 Posts: 59 Location: Poland
|
Posted: Wed Jul 14, 2010 1:00 pm Post subject: |
|
|
Maxter, eldar - thanks.
Maxter, your solution works, now everything compiles and links correctly.
One more question: How to set LD_LIBRARY_PATH permanently? |
|
Back to top |
|
|
eldar
Joined: 14 Jun 2008 Posts: 101 Location: Ufa, Russia
|
Posted: Wed Jul 14, 2010 1:47 pm Post subject: |
|
|
I don't know how to do it permanently, but for development purposes I put it in ~/.bashrc so that it is set each time you launch terminal. However if you double click on the executable linked to libraries that are there, they won't work, so you'll have to launch them from terminal as well. You may also google or ask someone else more knowledgeable. |
|
Back to top |
|
|
Lutger
Joined: 25 May 2006 Posts: 91
|
Posted: Thu Jul 22, 2010 6:04 pm Post subject: |
|
|
You can add the option -L-R/usr/local/lib to compile in the executable itself that it should lookup /usr/local/lib for shared libs. Run 'ldd main' to find out exactly which so's it can and cannot load.
There is usually a configuration file /etc/ld.so.conf where you can specify additional search paths, or a directory /etc/ld.so.conf.d/ where app specific conf files for those paths can be stored. The internet suggests however that LD_LIBRARY_PATH should only be used for development purposes and the -R switch is the preferred way to solve this problem.
I found these links useful:
http://linuxmafia.com/faq/Admin/ld-lib-path.html
http://www.eyrie.org/~eagle/notes/rpath.html
Great to see QtD compile easily by the way, it also works on 64-bit out of the box! (just by setting CXXFLAGS to -m32) |
|
Back to top |
|
|
|