Installation on Gentoo: QT3, QT4 and moc

Asked by kwaito

Hi,

I am using Gentoo Linux, and I have both QT3 and QT4 installed. The tagaini install script goes well, until it uses the 'moc' command. It gives this result:

/usr/qt/3/bin/moc -Isrc -I/usr/include/qt4 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtNetwork -o src/sqlite/moc_qsql_sqlite.cc src/sqlite/qsql_sqlite.h
Qt meta object compiler
moc: Invalid argument
Usage: moc [options] <header-file>
        -o file Write output to file rather than stdout
        -f[file] Force #include, optional file name
        -p path Path prefix for included file
        -i Do not generate an #include statement
        -k Do not stop on errors
        -nw Do not display warnings
        -v Display version of moc

The problem is that the used 'moc' command is the QT3 one, not the QT4. It is strange, because the '/usr/bin/moc' is the correct version (QT4), so the script uses instead '/usr/qt/3/bin/moc'.

I solved the problem by doing a temporary symlink from '/usr/qt/3/bin/moc' to '/usr/bin/moc' but it is not a very pretty solution.

It is the first time I use scons, so I do not know if the problem comes from Gentoo, scons, QT or tagaini, maybe you can help me ;-)

Question information

Language:
English Edit question
Status:
Solved
For:
Tagaini Jisho Edit question
Assignee:
No assignee Edit question
Solved by:
kwaito
Solved:
Last query:
Last reply:
Revision history for this message
Gnurou (gnurou) said :
#1

Hello, and thanks for your report!

It looks like the problem comes from the scons detection of Qt. I suspect that maybe you have a QTDIR environment variable that points to your Qt3 directory, which may confuse scons. In any way, I think setting the QTDIR environment variable to your Qt4 installation would solve your problem.

 Actually the current build process is not really pretty, I'd like to replace it by something cleaner but there is no better candidate than scons at the moment I'm afraid.

Apart from this problem, did the compilation complete successfully, and were you able to use the software as expected? I have never tried to build it on Gentoo so far.

Revision history for this message
kwaito (kwaito) said :
#2

I tried your way: I typed 'export QTDIR=/usr' and it worked. Thanks !

The compilation went fine, but I had these warnings:

- when I type 'scons release=yes lang=fr'
scons: warning: Two different environments were specified for target sqlite/moc_qsql_sqlite.cc,
        but they appear to have the same action: $QT4_MOC $QT4_MOCFROMHFLAGS $QT4_MOCINCFLAGS -o $TARGET $SOURCE

- and when tagaini builds the JMDict, sometimes 2 or 0 results are found:
[jmdict] Getting dictionary entities...
[jmdict] 109 entities found
[jmdict] Associating entities to tags and generating coding...
[jmdict] Creating tables...
[jmdict] Inserting entries...
[jmdict] 10000 entries processed
[jmdict] 20000 entries processed
[jmdict] 30000 entries processed
Entry 1358260: re_restr found 2 potential results!
Entry 1358260: re_restr found 2 potential results!
[jmdict] 40000 entries processed
[jmdict] 50000 entries processed
[jmdict] 60000 entries processed
[jmdict] 70000 entries processed
[jmdict] 80000 entries processed
[jmdict] 90000 entries processed
[jmdict] 100000 entries processed
Entry 2148010: re_restr found 0 potential results!
0 results found, skipping...
[jmdict] 110000 entries processed
Entry 2213120: re_restr found 0 potential results!
0 results found, skipping...
Entry 2228040: re_restr found 0 potential results!
0 results found, skipping...
[jmdict] 120000 entries processed
[jmdict] 130000 entries processed
Entry 2420250: re_restr found 0 potential results!
0 results found, skipping...
[jmdict] Inserting JLPT levels...
[jmdict] Creating tables indexes...
[jmdict] Optimizing database organization...
[...]

I can execute the program without problems, but when I want to print some cards in a PDF file, the font for the English/French translations is really ugly. Does tagaini use a default system font ?

Revision history for this message
Gnurou (gnurou) said :
#3

> The compilation went fine, but I had these warnings:
>
> - when I type 'scons release=yes lang=fr'
> scons: warning: Two different environments were specified for target sqlite/moc_qsql_sqlite.cc,
> but they appear to have the same action: $QT4_MOC $QT4_MOCFROMHFLAGS $QT4_MOCINCFLAGS -o $TARGET $SOURCE

This is "normal", and due to my lack of understanding of scons. Not a
problem for building though.

> - and when tagaini builds the JMDict, sometimes 2 or 0 results are found:

This is nothing to worry neither - these issues come from the JMdict
and do not interfere with Tagaini. They are here as a reminder for me
to signal them upstream, I should just remove them from regular
builds.

> I can execute the program without problems, but when I want to print
> some cards in a PDF file, the font for the English/French translations
> is really ugly. Does tagaini use a default system font ?

This is weird however - the font should actually be the same as the
one on-screen. Tagaini uses the default system font for both display
and printing. Be aware that some PDF renderers behave strangely
sometimes. I suggest you try to print directly on a printer and check
if the result is still ugly - if the printed result is conform to what
you seen on the PDF screen rendering, would you mind sending me a
screenshot of it?

Revision history for this message
kwaito (kwaito) said :
#4

Unfortunately, I do not have access to a printer directly, so I have to generate PDFs and then send them to someone, but as soon as I can use a printer without the PDF step, I will tell you.