PDA

View Full Version : Qt 4.1.2 Fails to build on Linux



rohandhruva
16th April 2006, 17:11
Hello,

I use Arch Linux (http://archlinux.org) and Frugalware Linux (http://frugalware.org). I have built and installed Qt 4.1.1 open source edition on arch linux. It worked perfectly.

However trying to compile Qt 4.1.2 fails with this error :

network/q3dns.cpp: In constructor 'Q3DnsAnswer::Q3DnsAnswer(Q3DnsQuery*)':
network/q3dns.cpp:267: internal compiler error: Segmentation fault

It is the first time I have seen the compiler segfault. Arch has gcc 4.0.3 and frugalware has gcc 4.1. Both give the same error. I have posted the error here :

http://aur.archlinux.org/packages.php?do_Details=1&ID=1383&O=0&L=0&C=0&K=qt4&SB=&SO=&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd

My comment is the last one, and the person above me too has the same type of error. I have confirmed one more person cannot compile it, and yet one more who can. Which is still confusing .. is it a random error ?

The buildscript I use is this -- http://aur.archlinux.org/packages/qt4/qt4/PKGBUILD

Basically I use this script because it helps me make a package for my distribution. Please help me, and post your results, and any suggestions.
Since this is a p3 550mhz 256mb ram, it compiles very slow, and hence it may take some time before I can post my results.

Thanks.

jacek
16th April 2006, 17:47
I guess here's the solution:
Comment by: shastry on 20060310 [10:32:31]
Hmm a compiler error. are you using stuff from testing ? (the new gcc/glibc combo may be?)
Compiles fine using current... for everyone..
If you are using testing stuff, try downgrading to current and give it a shot.

Comment by: UnrealX on 20060310 [12:25:09]
Downgraded to current and everything went fine. Thanks for this package again.
I use GCC 3.3.6 on my system (PLD Linux (http://www.pld-linux.org)) and everything compiles fine. I've tried GCC 4.x once and got random internal compiler errors (AFAIR I was using Qt 3 at that time).

rohandhruva
16th April 2006, 19:55
Arch current contains gcc 4.0.3 and glibc 2.3.6, so shastry's comment is not longer valid. Also, the same system compiled and ran Qt 4.1.1 fine. I am posting that error message from gcc 4.1 based frugalware, though. The problem with gcc 4.1 is that it doesnt allow


foo :: foo (args)

you need to type


foo (args)

I experienced the same problem while compiling knemo, but the compiled didnt segfault at that time. Is there any gcc 4.1 patch for Qt 4.1.2 available ?

Rohan.

jacek
16th April 2006, 20:09
gcc 4.1 is that it doesnt allow


foo :: foo (args)

you need to type


foo (args)
Well... that's really weird. A new kind of C++?

Q3DnsAnswer::Q3DnsAnswer() looks like any other constructor --- there's nothing special about it:
Q3DnsAnswer::Q3DnsAnswer( Q3DnsQuery * query_ )
{
ok = true;

answer = 0;
size = 0;
query = query_;
pp = 0;
rrs = new Q3PtrList<Q3DnsRR>;
rrs->setAutoDelete( false );
next = size;
ttl = 0;
label.clear();
rr = 0;

Q3DnsRR * newrr = new Q3DnsRR( query->l );
newrr->t = query->t;
newrr->deleteTime = query->started + 10;
newrr->expireTime = query->started + 10;
newrr->nxdomain = true;
newrr->current = true;
rrs->append( newrr );
}


Is there any gcc 4.1 patch for Qt 4.1.2 available ?
I don't think so. IMO it is better to use a more reliable version of GCC, instead of changing the code.

rohandhruva
16th April 2006, 21:17
Yes, I agree patching is not good. Now yet another person on gentoo reported it compiles just fine with gcc 4.1 , though


USE="cups gif jpeg opengl png zlib -accessibility -debug -doc -examples -fire bird -mng -mysql -nas -nis -odbc -postgres -sqlite -xinerama"

meaning that he disabled so much of qt4 !
Any more brainstorms please ?

jacek
16th April 2006, 21:35
Now yet another person on gentoo reported it compiles just fine with gcc 4.1 , though


USE="cups gif jpeg opengl png zlib -accessibility -debug -doc -examples -fire bird -mng -mysql -nas -nis -odbc -postgres -sqlite -xinerama"

meaning that he disabled so much of qt4 !
The biggest difference is that the debug mode was disabled. AFAIR by default Qt is built in both debug and release mode. Did you try passing "-release" option to the configure utility?

I found this line in the PKGBUILD file:

sed -i "s|read acceptance|acceptance=yes|" configure
Why don't you use "-confirm-license" instead?

rohandhruva
16th April 2006, 21:44
Ok, i will try passing only -release instead of enabling debug. Also, that PKGBUILD i provided is "shastry"'s now my own, so I am sorry I didnt read ./configure -help fully :) I will use accept-licence from now on !

Will post my results ASAP, but it will take about 7 hours to compile, so please keep giving more suggestions !

Rohan.

Edit :
1) What difference does enabling / disabling debug make ? I am very new to qt, and I wanted to start off from learning qt4, not qt3.

2) Is 'libtool-slay' proper for qt4 ? i.e. delete all .la files found in the package.

3) Is it recomended to change the official qt CFLAGS ? Since arch and frugalware define their own cflags. However you can see shastry has sed'ed a bit to get qt4 follow them. Is that problematic ?