Qt-jambi-interest Archive, April 2007
beta2 compilation
Message 1 in thread
Moin moin,
I'm having a hard time compiling Qt Jambi beta2 here.
First of all compiling the generator failed in metainfogenerator.cpp,
line 336. There was
writeInitializationFunctionName(s, fileHash.key(f, ""), true);
which should be
writeInitializationFunctionName(s, fileHash.key(f), true);
But well, that was doable ;). Then, generator and all compiled, I moved
on with the main compilation and got
> make[1]: Entering directory `/usr/src/qtjambi-src-gpl-1.0.0-beta2/qtjambi'
> g++ -c -pipe -march=athlon64 -O2 -pipe -Wall -W -D_REENTRANT -fPIC
> -DQTJAMBI_EXPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
> -I../../../share/qt4/mkspecs/linux-g++ -I.
> -I../../../include/qt4/QtCore -I../../../include/qt4/QtCore
> -I../../../include/qt4/QtGui -I../../../include/qt4/QtGui
> -I../../../include/qt4 -I. -I../common -I/opt/sun-jdk-1.6.0/include
> -I/opt/sun-jdk-1.6.0/include/linux -I. -I. -o qtjambi_core.o
> qtjambi_core.cpp
> qtjambi_core.cpp: In function 'JNIEnv* qtjambi_current_environment()':
> qtjambi_core.cpp:256: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp:258: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: In function 'QVariant qtjambi_to_qvariant(JNIEnv*,
> _jobject*)':
> qtjambi_core.cpp:363: error: call of overloaded 'QVariant(jlong)' is
> ambiguous
> ../../../include/qt4/QtCore/qvariant.h:186: note: candidates are:
> QVariant::QVariant(Qt::GlobalColor) <near match>
> ../../../include/qt4/QtCore/qvariant.h:167: note:
> QVariant::QVariant(const QChar&)
> ../../../include/qt4/QtCore/qvariant.h:164: note:
> QVariant::QVariant(const QString&) <near match>
> ../../../include/qt4/QtCore/qvariant.h:162: note:
> QVariant::QVariant(const QByteArray&) <near match>
> ../../../include/qt4/QtCore/qvariant.h:159: note:
> QVariant::QVariant(const char*) <near match>
> ../../../include/qt4/QtCore/qvariant.h:157: note:
> QVariant::QVariant(double)
> ../../../include/qt4/QtCore/qvariant.h:156: note:
> QVariant::QVariant(bool)
> ../../../include/qt4/QtCore/qvariant.h:155: note:
> QVariant::QVariant(qulonglong)
> ../../../include/qt4/QtCore/qvariant.h:154: note:
> QVariant::QVariant(qlonglong)
> ../../../include/qt4/QtCore/qvariant.h:153: note:
> QVariant::QVariant(uint)
> ../../../include/qt4/QtCore/qvariant.h:152: note:
> QVariant::QVariant(int)
> ../../../include/qt4/QtCore/qvariant.h:146: note:
> QVariant::QVariant(const QVariant&)
> ../../../include/qt4/QtCore/qvariant.h:144: note:
> QVariant::QVariant(QVariant::Type) <near match>
> qtjambi_core.cpp: In function 'QtJambiLink*
> qtjambi_construct_qobject(JNIEnv*, _jobject*, QObject*)':
> qtjambi_core.cpp:693: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: In function 'QThread* qtjambi_to_thread(JNIEnv*,
> _jobject*)':
> qtjambi_core.cpp:999: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: In function 'bool qtjambi_release_threads(JNIEnv*)':
> qtjambi_core.cpp:1035: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: In function 'QModelIndex
> qtjambi_to_QModelIndex(JNIEnv*, _jobject*)':
> qtjambi_core.cpp:1120: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: In function 'bool qtjambi_initialize_vm()':
> qtjambi_core.cpp:1342: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
> qtjambi_core.cpp: At global scope:
> qtjambi_core.cpp:1758: warning: 'bool qtjambi_event_notify(void**)'
> defined but not used
> make[1]: *** [qtjambi_core.o] Error 1
> make[1]: Leaving directory `/usr/src/qtjambi-src-gpl-1.0.0-beta2/qtjambi'
> make: *** [sub-qtjambi-make_default-ordered] Error 2
And now I'm lost, my cpp skillz are way to bad to find out how to fix
that, but I'm sure that there's someone who knows ;)
Best regards
Georg Schild
PS.: 64bit Linux (gentoo)
gcc 4.1.1
sun-jdk 1.6.0
Message 2 in thread
Hi, Georg.
Georg Schild skrev:
> I'm having a hard time compiling Qt Jambi beta2 here.
>
> First of all compiling the generator failed in metainfogenerator.cpp,
> line 336. There was
>
> writeInitializationFunctionName(s, fileHash.key(f, ""), true);
>
> which should be
>
> writeInitializationFunctionName(s, fileHash.key(f), true);
The QHash::key(const T &value, const Key &defaultValue) function used
here is actually a function introduced in Qt 4.3 which should be
available as a snapshot from Trolltech's web pages.
http://doc.trolltech.com/4.3/qhash.html#key-2
Note that there may be more issues related to building Jambi against an
earlier version of Qt.
>
>> qtjambi_core.cpp:363: error: call of overloaded 'QVariant(jlong)' is
>> ambiguous
>> ../../../include/qt4/QtCore/qvariant.h:186: note: candidates are:
>> QVariant::QVariant(Qt::GlobalColor) <near match>
>> ../../../include/qt4/QtCore/qvariant.h:167: note:
>> QVariant::QVariant(const QChar&)
>> ../../../include/qt4/QtCore/qvariant.h:164: note:
>> QVariant::QVariant(const QString&) <near match>
>> ../../../include/qt4/QtCore/qvariant.h:162: note:
>> QVariant::QVariant(const QByteArray&) <near match>
>> ../../../include/qt4/QtCore/qvariant.h:159: note:
>> QVariant::QVariant(const char*) <near match>
>> ../../../include/qt4/QtCore/qvariant.h:157: note:
>> QVariant::QVariant(double)
>> ../../../include/qt4/QtCore/qvariant.h:156: note:
>> QVariant::QVariant(bool)
>> ../../../include/qt4/QtCore/qvariant.h:155: note:
>> QVariant::QVariant(qulonglong)
>> ../../../include/qt4/QtCore/qvariant.h:154: note:
>> QVariant::QVariant(qlonglong)
>> ../../../include/qt4/QtCore/qvariant.h:153: note:
>> QVariant::QVariant(uint)
>> ../../../include/qt4/QtCore/qvariant.h:152: note:
>> QVariant::QVariant(int)
>> ../../../include/qt4/QtCore/qvariant.h:146: note:
>> QVariant::QVariant(const QVariant&)
>> ../../../include/qt4/QtCore/qvariant.h:144: note:
>> QVariant::QVariant(QVariant::Type) <near match>
>>
> And now I'm lost, my cpp skillz are way to bad to find out how to fix
> that, but I'm sure that there's someone who knows ;)
>
Unfortunately, this is a bug for building on 64 bit Linux. A fix which
should work is to add a "(qint64)" cast in line 363 in
qtjambi/qtjambi_core.cpp. I've attached a patch to this mail.
Hope this helps! Let us know if there are further problems.
-- Eskil
==== //depot/qtjambi/1.0.0-beta2/qtjambi/qtjambi_core.cpp#1 - c:\depot\qtjambi\1.0.0-beta2\qtjambi\qtjambi_core.cpp ====
==== //depot/qtjambi/1.0.0-beta2/qtjambi/qtjambi_core.cpp#1 - c:\depot\qtjambi\1.0.0-beta2\qtjambi\qtjambi_core.cpp ====
@@ -349,7 +349,7 @@
} else if (env->IsSameObject(sc->Double.class_ref, object_class)) {
return env->CallDoubleMethod(java_object, sc->Double.doubleValue);
} else if (env->IsSameObject(sc->Long.class_ref, object_class)) {
- return env->CallLongMethod(java_object, sc->Long.longValue);
+ return (qint64) env->CallLongMethod(java_object, sc->Long.longValue);
} else if (env->IsSameObject(sc->Boolean.class_ref, object_class)) {
return QVariant((bool) env->CallBooleanMethod(java_object, sc->Boolean.booleanValue));
}
Message 3 in thread
Hi Eskil,
Eskil Abrahamsen Blomfeldt schrieb:
> Hope this helps! Let us know if there are further problems.
hehe, the check for 4.3 is there, although quite late ;).
> g++ -c -pipe -march=athlon64 -O2 -pipe -Wall -W -D_REENTRANT -fPIC
> -DQTJAMBI_EXPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
> -I../../../share/qt4/mkspecs/linux-g++ -I.
> -I../../../include/qt4/QtCore -I../../../include/qt4/QtCore
> -I../../../include/qt4/QtGui -I../../../include/qt4/QtGui
> -I../../../include/qt4 -I. -I../common -I/opt/sun-jdk-1.6.0/include
> -I/opt/sun-jdk-1.6.0/include/linux -I. -I. -o qtjambi_functions.o
> qtjambi_functions.cpp
> qtjambi_functions.cpp:77:2: error: #error "Qt Jambi requires 4.3"
> make[1]: *** [qtjambi_functions.o] Error 1
> make[1]: Leaving directory `/usr/src/qtjambi-src-gpl-1.0.0-beta2/qtjambi'
> make: *** [sub-qtjambi-make_default-ordered] Error 2
So It really seems that I have to get a 4.3 snapshot installed, if there
only where 64bit binaries of jambi ;). Thanks for the help though.
Best regards
Georg Schild