I can't do a static build of Qt 4.7.0 for WinCE.
First I copied Qt 4.7.0 wince sources to C:\Qt\4.7.0_wince and ran a configure with params
-platform win32-msvc2008 -xplatform wincewm60professional-msvc2008
Then setcepath.bat for wincewm60professional-msvc2008 and then nmake. Everything was alright.
Now I need to do a static version of Qt's libs. How should I do this? I created another Qtdir with the same sources of Qt 4.7.0 wince in C:\Qt\4.7.0_wince_static and ran a configure with params
-release -nomake examples -nomake demos -no-qt3support -no-openssl -no-opengl -no-webkit -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -no-sql-sqlite -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 -qt-libjpeg -qt-libpng -qt-gif -static
Then setcepaths.bat for wincewm60professional-msvc2008. But when I ran nmake I got an error:
Generating Code...
link /LIBPATH:"c:\Qt\4.7.0_wince_static\lib" /LIBPATH:"c:\Qt\4.7.0_wince
_static\lib" /NOLOGO /NODEFAULTLIB:OLDNAMES.LIB /INCREMENTAL:NO /SUBSYSTEM:WINDO
WSCE,5.02 /MACHINE:THUMB /OUT:..\..\bin\qmlviewer.exe #C:\Users\SerGe\AppData\Lo
cal\Temp\nm315F.tmp
QtDeclarative.lib(qdeclarativevaluetype.obj) : warning LNK4217: locally defined
symbol ?qt_defaultDpi##YAHXZ (int __cdecl qt_defaultDpi(void)) imported in funct
ion "public: float __cdecl QDeclarativeFontValueType::pointSize(void)const " (?p
ointSize#QDeclarativeFontValueType##QBAMXZ)
QtGui.lib(jmemmgr.obj) : error LNK2019: unresolved external symbol getenv refere
nced in function jinit_memory_mgr
..\..\bin\qmlviewer.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\ce\bin\x86_arm\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
What's wrong? Please help me to solve this problem. Thanks in advance!!!
Related
I have QT 6.2.2 installed on Windows 10 and am trying to build qwt 6.2.0. Compilation via MSVC of the qwt library is successful but nmake outputs linker errors when compiling the qwt examples. I am attempting to compile all of qwt via the QT MSVC command prompt by loading vcvars from MSVC, running qmake, then running nmake as instructed here (https://qwt.sourceforge.io/qwtinstall.html#BUILDSUBSECTION).
The output of nmake is here:
Microsoft (R) Program Maintenance Utility Version 14.30.30706.0
Copyright (C) Microsoft Corporation. All rights reserved.
linking ..\bin\animation.exe
MSVCRT.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol WinMain referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh##YAHXZ)
..\bin\animation.exe : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'echo' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
I've tried this on two different windows 10 machines and run into the same problem on both machines.
Ran into the exact same problem yesterday. Found a solution (probably not the cleanest oen)
Edit every Makefile.Debug & Makefile.Release for the examples that raise that error.
at the end of the LFLAGS line, add "/ENTRY:mainCRTStartup".
Solution comes from: error LNK2019: unresolved external symbol _WinMain#16 referenced in function ___tmainCRTStartup
There is probably a smarter solution than editing so many files...
I am building qt5.7.0 from its source package with vs2015, following some instructions from the post How to Build Qt 5.7 Statically Using MSVC14 .
Here is my configure commands:
configure -static -debug-and-release -prefix “C:\Qt\5.7.0” -platform win32-msvc2015
Then the building processing is initiated by type nmake, but after a while it is stopped due to the error, namke fatal error U1077, as shown in the attached screenshot.
nmake clean
Download jom as a replacement of nmake for the building process (reconfigure and build)
Currently running Windows 10 vs2013 developer cp.
I'm trying to build PhantomJS from this fork but is failing on building Qt Base. I followed all the steps described on the ofical site.
The Qtbase is their own version I think it's a fork of Qt5.
The last log lines are the following ones:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -f Makefile.Release
cl -c -nologo -Zc:wchar_t -FS -O2 -MT -Zc:strictStrings -D_HAS_EXCEPTIONS=0 -MP -GR -W3 -w34100 -w34189 -w44996 -DUNICODE -DWIN32 -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_NO_CAST_FROM_ASCII -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_NO_GRAPHICSVIEW -DQT_NO_GRAPHICSEFFECT -DQT_NO_STYLESHEET -DQT_NO_STYLE_CDE -DQT_NO_STYLE_CLEANLOOKS -DQT_NO_STYLE_MOTIF -DQT_NO_STYLE_PLASTIQUE -DQT_NO_PRINTPREVIEWDIALOG -DNDEBUG -I. -I..\..\3rdparty\zlib -I..\..\..\include -I..\..\..\include\QtCore -I..\..\..\include\QtCore\5.6.2 -I..\..\..\include\QtCore\5.6.2\QtCore -IC:/phantom/src/qt/qtbase/include/QtXml -IC:/phantom/src/qt/qtbase/include/QtXml/5.6.2 -IC:/phantom/src/qt/qtbase/include/QtXml/5.6.2/QtXml -Itmp -IC:\phantom\src\qt\3rdparty\libicu\include -IC:\phantom\src\qt\3rdparty\libxml\include -IC:\phantom\src\qt\3rdparty\openssl\include -IC:\phantom\src\qt\3rdparty\zlib\include -I..\..\..\mkspecs\win32-msvc2013 -Fo.obj\release\ #C:\Users\xavi\AppData\Local\Temp\nm8087.tmp
qdom.cpp
..\..\xml\dom\qdom.cpp(35) : fatal error C1083: Cannot open include file: 'qdom.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
ERROR: Failed to build PhantomJS! Building Qt Base failed.
I can provide the full log if necessary.
I really appreciate any help you can provide.
I just came across a very similar error when trying to compile phantomjs by accident with VS2015. Solution was to use full version of VS2013 (I don't know if CTP will give you the correct _MSC_VER,) do a clean build (I just re-cloned) and to make sure to do the git submodule init and git submodule update commands before running the build script (so basically following directions!)
Not sure if this will help you but hopefully it does.
I am trying to build QT now for 2 days but it just doesn't work. This is what I did so far:
getting source (qt-everywhere-opensource-src-5.2.1)
installing perl, python, directx 9 sdk
adding perl, python to path variable
open cmd:
CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
set PATH=C:\Qt\Qt5.2.1source\qtbase\bin;C:\Qt\Qt5.2.1source\qtrepotools\bin;C:\Qt\Qt5.2.1source\gnuwin32\bin;%PATH%
set QMAKESPEC=win32-msvc2010
cd C:\Qt\Qt5.2.1source\
configure -debug -nomake examples -nomake tests -opensource -platform win32-msvc2010 -confirm-license (also tried with -opengl desktop)
nmake
And then I get this error message:
qplatformopenglcontext.cpp
c:\qtdev\qtbase-build\include\qtgui\../../../qtbase/src/gui/opengl/qopengl.h(55)
: fatal error C1083: Cannot open include file: 'GLES2/gl2.h': No such file or d
irectory
qopenglcontext.cpp
c:\qtdev\qtbase-build\include\qtgui\../../../qtbase/src/gui/opengl/qopengl.h(55)
: fatal error C1083: Cannot open include file: 'GLES2/gl2.h': No such file or d
irectory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
the same like here: QT_BUG but this should be fixed in 5.1.0 so I guess I do something wrong but I don´t know what :( It´s driving me crazy! I tried several different confiure settings but always the same error.
Btw: I had the same error before I installed DirectX SDK, the only thing changed after installing was the warning after performing configure doesn't show anymore.
Do you have any clue how I can get this working?
Try to install DirectX SDK.
Read more: https://qt-project.org/forums/viewthread/36324
This what I did but it results in errors:
1: In win32-msvc2008\qmake.conf I set QMAKE_CFLAGS_RELEASE = -O1 -Og -GL -MD
2: From MSVC2008 CMD I run vcvarsall.bat x86 and vcvars32.bat "C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
3: From Qt 4.6.2 CMD I run the following
C:\Qt\4.6.2>configure -release
-nomake examples -nomake demos -no-exceptions -n o-stl -no-rtti -no-qt3support -no-scripttools -no-openssl -no-opengl -no-webkit
-no-phonon -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique
-no-sql-sqlite -platform win32-msvc2008 -static -qt-libjpeg
-qt-zlib -qt-libpng
and then nmake
However, I ended up every time with these errors:
link /LIBPATH:"c:\Qt\4.6.2\lib"
/LIBPATH:"c:\Qt\4.6.2\lib" /NOLOGO
/INCR EMENTAL:NO /MANIFEST
/MANIFESTFILE:"tmp\obj\release_static\assistant_adp.interme
diate.manifest" /SUBSYSTEM:WINDOWS
"/MANIFESTDEPENDENCY:type='win32'
name='Micro
soft.Windows.Common-Controls'
version='6.0.0.0'
publicKeyToken='6595b64144ccf1df '
language=''
processorArchitecture=''"
/OUT:......\bin\assistant_adp.exe #C
:\DOCUME~1\Geeko\LOCALS~1\Temp\nm3F8.tmp
fontpanel.obj : MSIL .netmodule or
module compiled with /GL found;
restarting li nk with /LTCG; add /LTCG
to the link command line to improve
linker performance main.obj : error
LNK2001: unresolved external symbol
"class QObject * __cdecl qt
_plugin_instance_qjpeg(void)" (?qt_plugin_instance_qjpeg##YAPAVQObject##XZ)
......\bin\assistant_adp.exe : fatal
error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077:
'"C:\Program Files\Microsoft Visual
Studio 9.0\VC\BIN \link.EXE"' : return
code '0x460' Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN \nmake.exe"' : return code '0x2' Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2' Stop.
Thank you in deed.
I tried to do it with MS VS 2008 and it worked.
C:\Qt\4.6.2>configure -release -static -opensource -no-fast -no-exceptions -no-accessibility -no-rtti -no-stl -no-opengl -no-openvg -no-incredibuild-xge -no-style-plastique -no-style-cleanlooks -no-style-motif -no-style-cde -no-style-windowsce -no-style-windowsmobile -no-style-s60 -no-gif -no-libpng -no-libtiff -no-libjpeg -no-libmng -no-qt3support -no-mmx -no-3dnow -no-sse -no-sse2 -no-iwmmxt -no-openssl -no-dbus -platform win32-msvc2008 -arch windows -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-script -no-scripttools -webkit -no-declarative
However, I get these errors when building a project that links statically to QWebKit:
1>Creating library C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.lib and object C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exp
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _VerQueryValueW#16 referenced in function "class WebCore::String __cdecl WebCore::getVersionInfo(void * const,class WebCore::String const &)" (?getVersionInfo#WebCore##YA?AVString#1#QAXABV21##Z)
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoW#16 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo#PluginPackage#WebCore##AAE_NXZ)
1>QtWebKit.lib(PluginPackageWin.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeW#8 referenced in function "private: bool __thiscall WebCore::PluginPackage::fetchInfo(void)" (?fetchInfo#PluginPackage#WebCore##AAE_NXZ)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__PathRemoveFileSpecW#4 referenced in function "class WebCore::String __cdecl WebCore::safariPluginsDirectory(void)" (?safariPluginsDirectory#WebCore##YA?AVString#1#XZ)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__SHGetValueW#24 referenced in function "void __cdecl WebCore::addWindowsMediaPlayerPluginDirectory(class WTF::Vector<class WebCore::String,0> &)" (?addWindowsMediaPlayerPluginDirectory#WebCore##YAXAAV?$Vector#VString#WebCore##$0A##WTF###Z)
1>QtWebKit.lib(PluginDatabaseWin.obj) : error LNK2019: unresolved external symbol __imp__PathCombineW#12 referenced in function "void __cdecl WebCore::addMacromediaPluginDirectories(class WTF::Vector<class WebCore::String,0> &)" (?addMacromediaPluginDirectories#WebCore##YAXAAV?$Vector#VString#WebCore##$0A##WTF###Z)
1>C:\Users\Geeko\Desktop\Qt\TestQ\Release\TestQ.exe : fatal error LNK1120: 6 unresolved externals
Do I need to check something in the Qt project options ?
I have QtCore, QtGui, Network and WebKit checked.
Try setting these environment variables :
QTDIR : c:\Qt\4.6.2 or wherever you unzipped the Qt sources.
QMAKESPEC : win32-msvc2008
%QTDIR%/bin to the PATH
And use the 'Visual Studio 2008 Command Prompt' (in the Tools menu in VS2008) instead of the Qt one.
Have you considered the std::string types Qt is choosing per defaults?
It's a little compiler switch -Zc:wchar_t- that explicitly defines wchar_t as an unsigned short instead of a built in type.
If you omit the - at the end, i.e. -Zc:wchar_t it changes and might be more compatible to your project.