Как собрать Qt5 с qtwebkit на Windows с MSVC 2008 - leveldb не может найти stdint.h
На Windows 7 x64 box:
- Я установил Microsoft Windows SDK для Windows 7 и.NET Framework 3.5 SP1
- Я скачал и разархивировал исходный код Qt5.4.0 из раздела "Исходные пакеты и другие выпуски" на http://www.qt.io/download-open-source/
- я построил
ICU 54.1
из исходного кода и установить его, в соответствии с http://qt-project.org/wiki/Compiling-ICU-with-MSVC. - Я создал ярлык командной строки для http://doc.qt.io/qt-5/windows-building.html.
- Я добавил материал в командную строку в соответствии с http://qt-project.org/wiki/Building_Qt_5_from_Git и разделом использования http://qt-project.org/wiki/Compiling-ICU-with-MSVC.
Итак, мой qt5vars.cmd:
CALL "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
SET _ROOT=C:\qt\qt540
SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;C:\Python27;C:\Python27\Scripts;%PATH%
REM Uncomment the below line when using a git checkout of the source repository
REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
SET QMAKESPEC=win32-msvc2008
SET PATH=%PATH%;C:\icu\dist\lib;C:\Ruby193\bin
SET INCLUDE=%INCLUDE%;C:\icu\dist\include
SET LIB=%LIB%;C:\icu\dist\lib
SET _ROOT=
- Я обновил
qtwinextras\src\winextras\winshobjidl_p.h
для компиляции Qt 5.3.2 + VS2008 + ошибка SDK7.1 SHARDAPPIDINFOLINK. - В соответствии с https://groups.google.com/forum/ и C99 stdint.h заголовком и MS Visual Studio я скопировал
stdint.h
отC:\Program Files\Microsoft Visual Studio 10.0\VC\include
на другой машине, и вставил его вC:\Qt\qt540\qtwebkit\Source\WTF\wtf
, Я закомментировал декларациюWCHAR_MIN
и скопировал этот измененный stdint.h вc:\qt\qt540\qtwebkit\source\javascriptcore\runtime
,
С этой настройкой, из приглашения qt5vars.cmd выше, я настроил Qt с помощью:
configure -prefix% CD% \ qtbase -developer-build -opensource -opengl desktop -nomake tests -no-compile-examples -skip qtwebkit-examples -icu -plugin-sql-sqlite -platform win32-msvc2008 -confirm-license
Потом побежал nmake
, Я получаю кучу ошибок, которые leveldb не может найти stdint.h:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/filename.h(10) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
c.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/c.h(50) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
dbformat.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
db_impl.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
db_iter.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/db_iter.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
filename.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/filename.h(10) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
log_reader.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/log_reader.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
log_writer.cc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/log_writer.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
memtable.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
repair.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
table_cache.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\db/table_cache.h(11) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
version_edit.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
version_set.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
write_batch.cc
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\include\leveldb/db.h(8) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '(' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Существует stdint.h в C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\port\win
, но копирую этот файл или мой измененный stdint.h в leveldb\db
а также leveldb\include\leveldb
не имеет значения - я получаю те же ошибки при сборке Qt.
Что мне нужно сделать, чтобы собрать qtwebkit с помощью Qt, или хотя бы решить эту проблему leveldb sdtint.h?
1 ответ
ОК, я дурачок Просто нужно скопировать stdint.h
в C:\Program Files\Microsoft Visual Studio 9.0\VC\include
вместо пути к каждому файлу, который жалуется. Кроме того, я закомментировал заявление WCHAR_MIN
в stdint.h, чтобы избежать множества предупреждений о его повторном выделении.
Затем с помощью configure
Заявление в исходном вопросе, Qt5.4.0 успешно собран, включая qtwebkit! На сборку ушло 11 часов, но все заработало!