Can't compile editor: Qt4 dev libs not found

For those having trouble installing/running the game or to report a bug

Moderator: Staff

User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Can't compile editor: Qt4 dev libs not found

Postby Roots » Fri Dec 07, 2012 4:00 am

Having this issue on Ubuntu Linux 12.10. I can't get the map editor to compile because it can not find the QT4 development libraries on my system. The following is what is printed out after running ./configure:

Code: Select all

checking whether to enable usage of map editor... yes
checking for Qt4 headers... /usr/include/qt4
checking for Qt4 libraries... no
configure: error: in `/home/olsent/dev/allacrost/trunk/game':
configure: error: Qt4 development libraries not found
See `config.log' for more details


I spent some time this evening doing some investigation and trying to fix this myself, but haven't had any luck so far. What I did figure out was that the file which does all the QT4 library discovery/testing is in m4/qt.m4. In that file there are some code blocks that do this work, "AC_DEFUN([HOA_FIND_QT4]" is the one we care about (I think). There is a variable that contains a list of locations to search for headers and libraries:

Code: Select all

qt4_incdirs="/usr/local/qt/include /usr/include/qt4 /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt/include /usr/lib/qt4/include"
qt4_libdirs="/usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt/lib /usr/lib/qt4/lib /usr/lib/qt4"


In my distribution, I noticed that my QT4 development libraries appear to be installed at "/usr/lib/x86_64-linux-gnu", so I added that path in the qt4_libdirs string. However, the same problem still occurred.


And that's as far as I was able to get. I'm not an expert at m4 code or GNU autotools so I'm not sure what I need to do here. I may play around with it more later, but I'm hoping that someone else can take a look at it and figure out what's wrong.


The workaround for this problem is to simply not compile the map editor. Running ./configure with the option "--disable-editor" will remove the QT4 requirements. Until this problem is fixed, I'm unable to use or work on the map editor code.
Image
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Can't compile editor: Qt4 dev libs not found

Postby nemesis » Tue Dec 18, 2012 6:59 pm

Did you already fix this issue?

If not, I can have a look on Ubuntu 12.04. Or did you work previously with 12.04 and it have worked back then?
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Can't compile editor: Qt4 dev libs not found

Postby Roots » Tue Dec 18, 2012 7:41 pm

No, I haven't had time to fix this. I'm not sure if it compiles on Ubuntu 12.04 or not. I think the Ubuntu folks might have moved the libQT directories in 12.10, so it's possible that it may work. Either way, if you can try compiling it on 12.04 and see if it works, that's good information to have. And if it doesn't work, then maybe you can find a fix. :angel:
Image
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Can't compile editor: Qt4 dev libs not found

Postby nemesis » Wed Dec 19, 2012 12:57 am

Same problem for me, don't know how to write configure scripts.

However, back to the problem. Had the same issue in Ubuntu 12.04. But after adding

Code: Select all

/usr/lib/i386-linux-gnu -> Location on my system


to

Code: Select all

qt4_libdirs="/usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt/lib /usr/lib/qt4/lib /usr/lib/qt4 /usr/lib/i386-linux-gnu"


it worked (configure script created makefile w/o problems and compilation went also through). However, I needed to add it two times in the configure script, once a few lines above

Code: Select all

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 libraries" >&5


and then a few lines above

Code: Select all

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for QtOpenGL libraries" >&5


Maybe that was what went wrong for your try, that you've put it only in one location. However, as far as I could see, the second test (OpenGL) is not neccessary, since the OpenGL libraries are also included in the original Qt4 test.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Can't compile editor: Qt4 dev libs not found

Postby Roots » Wed Dec 19, 2012 3:14 am

I never modified the configure script directly, because you shouldn't need to. The configure script is generated by configure.ac (I think), which is what I was fiddling with. Makefile.am is another file I often have to make modifications to. Regardless, I'm glad to hear that you got it to work. :)
Image
rujasu
Developer
Posts: 758
Joined: Sun Feb 25, 2007 5:40 am
Location: Maryland, USA

Re: Can't compile editor: Qt4 dev libs not found

Postby rujasu » Wed Dec 19, 2012 7:12 am

I think I've got this. Looks like the file m4/qt.m4 is what needed to be changed. Commit should be incoming.
User avatar
Roots
Dictator
Posts: 8665
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Re: Can't compile editor: Qt4 dev libs not found

Postby Roots » Wed Dec 19, 2012 10:35 am

Yay, the commit fixed it for me. Thanks guys. :approve: If other Linux systems have the same issue, I guess we'll just need to add more possible paths to the library. At least we know now how to add that support.
Image
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Can't compile editor: Qt4 dev libs not found

Postby nemesis » Wed Dec 19, 2012 10:55 am

I never modified the configure script directly, because you shouldn't need to.


That's right. But since it was very late for me yesterday it was the easiest to have a look there. I was also sure that a modification of the m4 scripts is the right approach, but I was too lazy too search. ;)
rujasu
Developer
Posts: 758
Joined: Sun Feb 25, 2007 5:40 am
Location: Maryland, USA

Re: Can't compile editor: Qt4 dev libs not found

Postby rujasu » Wed Dec 19, 2012 2:52 pm

Roots wrote:If other Linux systems have the same issue, I guess we'll just need to add more possible paths to the library. At least we know now how to add that support.


Well, what I'm thinking is there may be a system variable we can reference, based on the current architecture? I don't know enough about M4 or multiarch to know exactly if or how we'd do that, but it seems like it should be along the lines of "FIND_ARCH_USR_LIB" rather than "/usr/lib/i386 AND /usr/lib/x86_64 AND /usr/lib/arm AND whatever else we're forgetting". That's not a huge major thing, though.
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Can't compile editor: Qt4 dev libs not found

Postby nemesis » Wed Dec 19, 2012 5:07 pm

I don't know if this is really a good option, but one can also use symbolic links to the libQt... files. Maybe create the lib folder in /usr/lib/qt4 and link all files into this folder. Maybe someone with more experience in Linux can tell me if this can be done or better should not be done...
rujasu
Developer
Posts: 758
Joined: Sun Feb 25, 2007 5:40 am
Location: Maryland, USA

Re: Can't compile editor: Qt4 dev libs not found

Postby rujasu » Thu Dec 20, 2012 2:51 am

nemesis wrote:I don't know if this is really a good option, but one can also use symbolic links to the libQt... files. Maybe create the lib folder in /usr/lib/qt4 and link all files into this folder. Maybe someone with more experience in Linux can tell me if this can be done or better should not be done...


Yeah, I would say this is probably not a good idea. We don't want to get root privileges and mess with the system /usr/lib setup before we even compile the game. This isn't Windows. ;)
nemesis
Senior Member
Posts: 157
Joined: Fri Apr 29, 2011 7:53 am
Location: Sachsen/Germany

Re: Can't compile editor: Qt4 dev libs not found

Postby nemesis » Thu Dec 20, 2012 10:27 am

I knew an answer like this must come... ;)

Return to “Technical Issues”

Who is online

Users browsing this forum: No registered users and 2 guests