FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Doesn't build on QT 4.7 Beta.
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> QtD
View previous topic :: View next topic  
Author Message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Jun 16, 2010 9:31 am    Post subject: Doesn't build on QT 4.7 Beta. Reply with quote

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
View user's profile Send private message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Wed Jun 23, 2010 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Jun 23, 2010 2:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
SgtMuffles



Joined: 30 Dec 2007
Posts: 1

PostPosted: Fri Jun 25, 2010 11:03 am    Post subject: Reply with quote

For the missing Traits.d file, you can copy the one from http://dsource.org/projects/qtd/browser/d2/qtd/Traits.d to /usr/local/include/d/qtd/Traits.d and it should work fine. It did for me.
Back to top
View user's profile Send private message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Wed Jun 30, 2010 1:06 am    Post subject: Reply with quote

Should have been fixed in http://www.dsource.org/projects/qtd/changeset/367%3Af69341b40588. Please use the latest trunk.
Back to top
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Tue Jul 13, 2010 11:51 am    Post subject: Reply with quote

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.dSad.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
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Tue Jul 13, 2010 1:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Jul 14, 2010 4:33 am    Post subject: Reply with quote

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 Smile


Last edited by Mitu on Wed Jul 14, 2010 4:56 am; edited 2 times in total
Back to top
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Wed Jul 14, 2010 4:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Jul 14, 2010 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
maxter



Joined: 17 May 2006
Posts: 34

PostPosted: Wed Jul 14, 2010 9:18 am    Post subject: Reply with quote

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
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Wed Jul 14, 2010 11:53 am    Post subject: Reply with quote

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
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Wed Jul 14, 2010 1:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
eldar



Joined: 14 Jun 2008
Posts: 101
Location: Ufa, Russia

PostPosted: Wed Jul 14, 2010 1:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Lutger



Joined: 25 May 2006
Posts: 91

PostPosted: Thu Jul 22, 2010 6:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> QtD All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group