Qt Jambi build failure (VS2010)

272 views Asked by At

I've successfully built Qt 4.8.4 on Windows 7 and now I'm trying to build Qt Jambi against that version. When I run ant in the Qt Jambi source directory to kick off the build I get only part of the way and then I end up with the following

cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_QTJAMBI_IMPORT -DQT_DLL -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\qt-everywhere-opensource-src-4.8.4\include\QtCore" -I"..\..\qt-everywhere-opensource-src-4.8.4\include" -I"..\qtjambi" -I"..\common" -I"C:\Program Files\Java\jdk1.7.0_09\include" -I"C:\Program Files\Java\jdk1.7.0_09\include\win32" -I"." -I"..\..\qt-everywhere-opensource-src-4.8.4\include\ActiveQt" -I"release" -I"..\..\qt-everywhere-opensource-src-4.8.4\mkspecs\default" -Forelease\ @C:\Users\TYLERS~1\AppData\Local\Temp\nmFBCC.tmp qtjambishell_QLocale.cpp

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(885) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1int_1String__JILjava_lang_String_2(JNIEnv *,jobject,jlong,jint,jobject)' already has a body

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(808) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1int_1String__JILjava_lang_String_2'

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(909) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1long_1String__JJLjava_lang_String_2(JNIEnv *,jobject,jlong,jlong,jobject)' already hasa body

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(832) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1long_1String__JJLjava_lang_String_2'

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(933) : error C2084: function 'jobject Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1char_1String__JCLjava_lang_String_2(JNIEnv *,jobject,jlong,jchar,jobject)' already has a body

..\cpp\com_trolltech_qt_core\qtjambishell_QLocale.cpp(856) : see previous definition of 'Java_com_trolltech_qt_core_QLocale__1_1qt_1toCurrencyString_1char_1String__JCLjava_lang_String_2'

NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

There are a few MSDN entries regarding this error number--http://msdn.microsoft.com/en-us/library/dt309377.aspx and http://msdn.microsoft.com/en-us/library/s99zy1dh(v=vs.100).aspx. Neither of these really helps much.

Has anyone successfully done what I'm attempting?

2

There are 2 answers

0
Darryl Miles On

Building QtJambi on VS2010 does work.

Please confirm where you obtained your Qt SDK from and where you obtained your QtJambi sources from.

You should be working with Nokia or Digia SDKs or Qt Project. Such as 4.x from https://qt-project.org/downloads (note 5.x does not work at this time maybe for start of 2014).

You should be working from the git tree at https://qt.gitorious.org/qt-jambi/qtjambi-community (this is the only maintained tree). Please confirm the commit-id you are working with.

If you do not have git for Win7 take a look at http://git-scm.com/download/win once installed you can open the "git bash" shell and from a clean directory checkout the source with git clone git://gitorious.org/qt-jambi/qtjambi-community.git

Can you confirm you have correctly started your cmd.exe shell on Win7 from using the start menu options provided with VS2010. Such as Visual Studio 2010 Command Prompt and from here confirm you have setup the environment variables JAVA_HOME (pointing to your JDK) and QTSDK (pointing to the Qt SDK toplevel directory containing the desktop build for MS2010).

My guess is you are not using the correct Qt Jambi source tree. A patch has existed in the tree for 4.8.x support since Dec 2011. That appears to address the issue you are having.

0
Bjørner On

Have successfully compiled QtJambi from QtJambi trunk at gitorious. Then I used the Qt 4.8.4 SDK from Qt-project.org. http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-win-opensource-4.8.5-vs2010.exe I used it some months now and it works nice :).

Enjoy QtJambi!