Qt-jambi-interest Archive, January 2007
Running the generator on Linux
Message 1 in thread
Hello!
I've tried to run the generator_example.sh on Crux 2.2, after first
having installed Qt4 successfully.
However, I get this printout on screen:
# generator_example.sh
Running generator
Generator requires QTDIR to be set
Preprocessor failed on file: 'mywidget.h'
Compiling Native library
Project LOAD(): Feature qt_config cannot be found.
make: *** No targets specified and no makefile found. Stop.
Compiling Java Sources
javac: file not found: com/trolltech/examples/generator/*.java
Usage: javac <options> <source files>
use -help for a list of possible options
Compilation done...
You should now be able to run ./qtjambi.sh and run the GeneratorExample
I did set the QTDIR variable to /usr/lib/qt.
My directory structure here is:
# ll /usr/lib/qt/
total 17
drwxr-xr-x 9 root root 256 Jan 11 08:59 .
drwxr-xr-x 24 root root 17768 Jan 11 08:59 ..
drwxr-xr-x 2 root root 144 Jan 11 08:59 accessible
drwxr-xr-x 2 root root 176 Jan 11 08:59 codecs
drwxr-xr-x 2 root root 296 Jan 11 08:59 designer
drwxr-xr-x 2 root root 80 Jan 11 08:59 iconengines
drwxr-xr-x 2 root root 176 Jan 11 08:59 imageformats
drwxr-xr-x 2 root root 88 Jan 11 08:59 inputmethods
drwxr-xr-x 2 root root 80 Jan 11 08:59 sqldrivers
and the directory structure for /usr/include/qt
# ll /usr/include/qt
total 62
drwxr-xr-x 15 root root 400 Jan 11 08:59 .
drwxr-xr-x 52 root root 6128 Jan 11 08:59 ..
drwxr-xr-x 2 root root 14216 Jan 11 08:59 Qt
drwxr-xr-x 2 root root 9552 Jan 11 08:59 Qt3Support
drwxr-xr-x 2 root root 200 Jan 11 08:59 QtAssistant
drwxr-xr-x 2 root root 9384 Jan 11 08:59 QtCore
drwxr-xr-x 2 root root 3136 Jan 11 08:59 QtDesigner
drwxr-xr-x 2 root root 17552 Jan 11 08:59 QtGui
drwxr-xr-x 2 root root 984 Jan 11 08:59 QtNetwork
drwxr-xr-x 2 root root 400 Jan 11 08:59 QtOpenGL
drwxr-xr-x 2 root root 1712 Jan 11 08:59 QtSql
drwxr-xr-x 2 root root 272 Jan 11 08:59 QtSvg
drwxr-xr-x 2 root root 1008 Jan 11 08:59 QtTest
drwxr-xr-x 2 root root 144 Jan 11 08:59 QtUiTools
drwxr-xr-x 2 root root 1184 Jan 11 08:59 QtXml
Best regards,
Helge Fredriksen
Helge
Message 2 in thread
Helge Fredriksen wrote:
> Hello!
>
> I've tried to run the generator_example.sh on Crux 2.2, after first
> having installed Qt4 successfully.
>
> However, I get this printout on screen:
>
> # generator_example.sh
> Running generator
> Generator requires QTDIR to be set
> Preprocessor failed on file: 'mywidget.h'
> Compiling Native library
> Project LOAD(): Feature qt_config cannot be found.
> make: *** No targets specified and no makefile found. Stop.
> Compiling Java Sources
> javac: file not found: com/trolltech/examples/generator/*.java
> Usage: javac <options> <source files>
> use -help for a list of possible options
> Compilation done...
> You should now be able to run ./qtjambi.sh and run the GeneratorExample
>
> I did set the QTDIR variable to /usr/lib/qt.
Hi Helge,
The exact lines that fail in the generator are:
QString qtdir = getenv ("QTDIR");
if (qtdir.isEmpty()) {
fprintf(stderr, "Generator requires QTDIR to be set\n");
return false;
}
I don't see how this can fail in any other case than if you failed to
set your QTDIR variable. If you do "env" in the shell it contains QTDIR?
-
best regards,
Gunnar
Message 3 in thread
Gunnar Sletta wrote:
Oh, sorry, typo from me, had QDIR set instead :-)
Correcting that, getting me a bit further. Where should qt_config be
located?
Printout:
Running generator
WARNING(MetaJavaBuilder) :: Unknown baseclass for 'MyWidget': 'QWidget'
Classes in typesystem: 1
Generated:
- java......: 1
- cpp-impl..: 1
- cpp-h.....: 1
- meta-info.: 1
Done, 1 warnings (4 known issues)
Compiling Native library
Project LOAD(): Feature qt_config cannot be found.
make: *** No targets specified and no makefile found. Stop.
Compiling Java Sources
com/trolltech/examples/GeneratorExample.java:29: cannot find symbol
symbol : method addWidget(com.trolltech.examples.generator.MyWidget)
location: class com.trolltech.qt.gui.QVBoxLayout
layout.addWidget(new MyWidget(this));
^
1 error
Compilation done...
You should now be able to run ./qtjambi.sh and run the GeneratorExample
> Hi Helge,
>
> The exact lines that fail in the generator are:
>
> QString qtdir = getenv ("QTDIR");
> if (qtdir.isEmpty()) {
> fprintf(stderr, "Generator requires QTDIR to be set\n");
> return false;
> }
>
> I don't see how this can fail in any other case than if you failed to
> set your QTDIR variable. If you do "env" in the shell it contains QTDIR?
>
> -
> best regards,
> Gunnar
>
>
Message 4 in thread
Helge Fredriksen wrote:
> Gunnar Sletta wrote:
>
> Oh, sorry, typo from me, had QDIR set instead :-)
>
> Correcting that, getting me a bit further. Where should qt_config be
> located?
Its located in $QTDIR/mkspecs/features/qt_config.pri
Is this a "make installed" version of Qt 4?
> WARNING(MetaJavaBuilder) :: Unknown baseclass for 'MyWidget': 'QWidget'
This is unsettling indeed...
Your $QTDIR/include does contain QtGui/qwidget.h and friends, I suppose?
-
Gunnar
Message 5 in thread
Hmm, seems like my Crux distro has spread things all around.
I have mkspecs installed under /usr/share/qt, qwidget.h under
/usr/include/qt, executables under /usr/bin and libraries under
/usr/lib/qt....
This setup is intuitive to me, but it seems that the generator expects
all Qt stuff to be located in one place only?
Any way to hack around this with the generator, or should I download the
Qt tar ball and build/install without the
crux package regime? No big deal, but some finer control would have been
nice though...
Regards,
Helge
Gunnar Sletta wrote:
> Helge Fredriksen wrote:
>> Gunnar Sletta wrote:
>>
>> Oh, sorry, typo from me, had QDIR set instead :-)
>>
>> Correcting that, getting me a bit further. Where should qt_config be
>> located?
>
> Its located in $QTDIR/mkspecs/features/qt_config.pri
>
> Is this a "make installed" version of Qt 4?
>
>> WARNING(MetaJavaBuilder) :: Unknown baseclass for 'MyWidget': 'QWidget'
>
> This is unsettling indeed...
>
> Your $QTDIR/include does contain QtGui/qwidget.h and friends, I suppose?
>
> -
> Gunnar
>
Message 6 in thread
Helge Fredriksen wrote:
> Hmm, seems like my Crux distro has spread things all around.
>
> I have mkspecs installed under /usr/share/qt, qwidget.h under
> /usr/include/qt, executables under /usr/bin and libraries under
> /usr/lib/qt....
>
> This setup is intuitive to me, but it seems that the generator expects
> all Qt stuff to be located in one place only?
> Any way to hack around this with the generator, or should I download the
> Qt tar ball and build/install without the
> crux package regime? No big deal, but some finer control would have been
> nice though...
qt_config is loaded by qmake, regardless of the qtjambi generator so
this should be happening for all your projects then, which indicates
that your Qt installation is not working properly.
Also, Qt expects qwidget.h to be located in
$QTDIR/include/QtGui/qwidget.h. This is what should happen if you do a
make install of a source package at least.
Basing Qt Jambi on a proper Qt package would probably solve all these
problems.
-
Gunnar