PDA

View Full Version : Gcc compile problem



tigerknight
04-24-2003, 12:33 AM
I originally got ShowEQ working on gcc-2.95 and qt-2.3.2. However in the interest of following installation document guidelines I went up to gcc-3.0.4-7 and qt-3.0.6. This is where I've begun to have.. fun.

And before anyone asks - Yes I did a forum search. Nothing came back any closer than 1 year old. I also searched google and found no helpful information.

I'm running Debian 3.0 under a 2.4.20 686 kernel.
I've been building with gcc, g++ libgcc libg++ which are all 3.0.4-7, however those four also have 2.95 packages installed that are required by the distribution.

I followed README.newbies and other documents explicitly and here's the problem I'm getting with qt compiling:

./moc_yacc.o(.gnu.linkonce.t._ZN8QPtrListI13Namespac eInfoED0Ev+0x23): undefined reference to `operator delete(void*)'
./moc_yacc.o: In function `QPtrList<NamespaceInfo>::deleteItem(void*)':
./moc_yacc.o(.gnu.linkonce.t._ZN8QPtrListI13Namespac eInfoE10deleteItemEPv+0x3d): undefined reference to `operator delete(void*)'
./moc_yacc.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make[2]: *** [../../bin/moc] Error 1
make[2]: Leaving directory `/usr/local/qt-3.0.6/src/moc'
make[1]: *** [src-moc] Error 2
make[1]: Leaving directory `/usr/local/qt-3.0.6'
make: *** [init] Error 2


Now, I know this is not a qt problem - it's gcc. Next, about the only tidbit I /DID/ find useful was a note somewhere about how this might occure if gcc3 was linking to gcc295 libraries. I'd gladly chuck gcc295 except that on Debian it (gcc295) is a required package and gcc3 is optional.

Hell I might even upgrade to sarge if that would allow me to cut away 295 without a problem. I know enough about linux to be a good admin and a dangerous compiler. Anyone able to help me out?

AnotherCoreDump
04-24-2003, 02:25 AM
Yo!

It's a problem that the g++ didn't find the needed libraries I think.
had nearly the same messages with the qt-3.1.whateveristhenewestontrolltect.com, I was able to fix it by changing the make definitions.

to do that go to /usr/local/qt-3.0.6/mk*/linux-g++ (assuming that qt ./configure wants to use this setup), edit the qtmake.* file (don't know the exact names of directory and file, as I use TABexpansion), find the QMAKE_LIBRARIES or something definition and add -L/usr/experiemental/lib or something like that (wherever your g++3 is installed - Exact syntax not handy, have to check later today).
You also might want to change the associated compilers to g++3, gcc3 and such and sym-link the binaries of those to make absolutely sure that it compiles with the right version.
And - don't forget to start configure of qt with -threads (hmm something like taht), that it builds the libqt-mt version. Was needed for the latest qt version and did cost me 6 hrs of recompiling qt.

If you still got problems, just tell and I check the exact switches and stuff at home.

tigerknight
04-24-2003, 02:28 AM
I edited the mkspecs/linux-g++/qmake.conf file per INSTALL.newbies to have gcc-3.0 and g++-3.0 already

Like I said - I was a good boy and read all the docs and did searches on my problem before I posted here :]

AnotherCoreDump
04-24-2003, 02:32 AM
:) Well you're smarter than me :) Why use README when you can figure it out all yourself:)
I'll read them too when I come home, maybe they forgot something (though this might not help, as I got the newest version at home).
It really sounds like something just doesn't it's libraries.
Maybe if you want you can post what you actually did here ...

tigerknight
04-24-2003, 02:39 AM
Ran the cvs commands to get the latest showeq code.

Got the latest libeq and put it in the right place.

Downloaded qt-3.0.6 and made sure I had gcc and g++ 3, as well as the libstdc library packages to go with them. Had all the required tools (autoconf, automake, libtool, etc)

Changed the /usr/lib/qt-3.0.5/mkspecs/linux-g++/qmake.conf per instructed in INSTALL.newbies.

Ran a ./configure -thread on qt-3.0.6 (after having done IT'S install stuff of qtdir, ld_library_path or what not etc). Configure ran ok.

Did a make and came up with the error I mentioned above (a bunch of `operator delete(void*)' errors and then the `__gxx_personality_v0' error.

Searched the web for help (google is generally pretty good), searched the forums (nothing more recent than a year old). Broke down and posted here for help :]

AnotherCoreDump
04-24-2003, 06:27 AM
Yo!
Ok did download qt-3.0.5 and read INSTALL.newbies.

There might be a problem here:
-------------------------

1.4 Editting linux-g++-shared
edit the file "mkspecs/linux-g++/qmake.conf and change all
references to "gcc" to "gcc3" as well as "g++" to "g++3"
(lines 12, 27, 47, and 48). save your changes (ctrl-o, ctrl-x)

-------------------------

Additional to
QMAKE_CC = gcc3
QMAKE_CXX = g++3
QMAKE_LINK = g++3
QMAKE_LINK_SHLIB = g++3
i had to change some more definitions as it would choose the wrong include files and wrong libraries.

Please do the following:
# which g++
and
# which g++3
(assuming your g++3 is named like that).

For me one is installed somewhere obvious and the g++3 is in /opt/experimental/bin.

Now we only have to change the definitions here to make sure that g++3 takes the correct includes and libs:
Change QMAKE_INCDIR and QMAKE_LIBDIR to reflect where your g++3 is installed (which you found out with the which command):

QMAKE_INCDIR = /opt/experimental/include
QMAKE_LIBDIR = /opt/experimental/lib

would work for me, check what applies to you.

Hope this helps.

PS: Don't forget to do a ./configure again ....

tigerknight
04-24-2003, 01:14 PM
ah hah! Somehow in my last edit of the qmake.conf file when I was searching for gcc and g++ to replace it did not find the link line. Thanks! I don't know for sure if that is it but I'd be willing to place a bet that it is. Recompiling now. See you in a few hours. Probably.

tigerknight
04-24-2003, 07:45 PM
Success :] Finally. I don't know why the search for those other two lines failed - but that's what the problem was. Thanks folks!