Failed to build wasmtime in Windows 10 - windows

I tried to build wasmtime in Windows 10 but failed.
After running the command cargo build --release, I got the error message:
Done Building Project "G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj" (default targets) -- FAILED.
Done Building Project "G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Done Building Project "G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\install.vcxproj" (default targets) -- FAILED.
Build FAILED.
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\install.vcxproj" (default target) (1) ->
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\ALL_BUILD.vcxproj" (default target) (3) ->
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj" (default target) (4) ->
(ClCompile target) ->
g:\wasi\wasmtime\wasmtime-wasi\sandboxed-system-primitives\src\str.c(22): warning C4047: 'initializing': 'char *' differs in levels of indirection from 'int' [G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj]
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\install.vcxproj" (default target) (1) ->
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\ALL_BUILD.vcxproj" (default target) (3) ->
"G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj" (default target) (4) ->
(ClCompile target) ->
g:\wasi\wasmtime\wasmtime-wasi\sandboxed-system-primitives\src\posix.c(16): fatal error C1083: Cannot open include file: 'sys/ioctl.h': No such file or directory [G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj]
g:\wasi\wasmtime\wasmtime-wasi\sandboxed-system-primitives\src\random.c(15): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory [G:\wasi\wasmtime\target\release\build\wasmtime-wasi-628aff801f2e5951\out\build\SandboxedSystemPrimitives.vcxproj]
1 Warning(s)
2 Error(s)
The sys/ioctl.h and pthread.h files cannot be found.
I have MinGW, CMake and LLVM installed. Do I need to install other Linux-relevant tools to build it?

Related

How to debug dsymutil error: “Clang modules are expected to have exactly 1 compile unit.”

Received this error message during GenerateDSYMFile phase for an iOS app:
/Users/name/Library/Developer/Xcode/DerivedData/ModuleCache/HASH/FrameworkName-HASH:
Clang modules are expected to have exactly 1 compile unit.
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil
failed with exit code 1
Deleted:
~/Library/Developer/Xcode/DerivedData
And was able to build again.

Building PoDoFo-Library (v.0.9.4) on Windows - stricmp has not been declared

i tried to build PoDoFo-Library version 0.9.4 on a Windows 10 (64-Bit) machine.
I followed the instructions of the developer and some i found here on Stackoverflow. So i did the following steps but they are resulting on this error:
Scanning dependencies of target podofo_shared
[ 0%] Building CXX object src/CMakeFiles/podofo_shared.dir/base/PdfArray.cpp.obj
In file included from C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfDefinesPrivate.h:9:0,
from C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfArray.cpp:37:
C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfCompilerCompatPrivate.h: In function 'int PoDoFo::compat::strcasecmp(const char*, const char*)':
C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfCompilerCompatPrivate.h:87:16: error: '::stricmp' has not been declared
return ::stricmp(s1, s2);
^
C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfCompilerCompatPrivate.h: In function 'int PoDoFo::compat::strncasecmp(const char*, const char*, size_t)':
C:\Users\PeterFox\Downloads\podofo-src\src\base\PdfCompilerCompatPrivate.h:101:16: error: '::strnicmp' has not been declared
return ::strnicmp(s1, s2, n);
^
src\CMakeFiles\podofo_shared.dir\build.make:62: recipe for target 'src/CMakeFiles/podofo_shared.dir/base/PdfArray.cpp.obj' failed
mingw32-make[2]: *** [src/CMakeFiles/podofo_shared.dir/base/PdfArray.cpp.obj] Error 1
CMakeFiles\Makefile2:116: recipe for target 'src/CMakeFiles/podofo_shared.dir/all' failed
mingw32-make[1]: *** [src/CMakeFiles/podofo_shared.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
So here are the steps i did:
First installed MinGW on my machine and added the bin-folder to the PATH-var. Then i installed GnuWin32 with all packages and CMake. All three are as the latest version available.
Zlib und Freetype Libs which are needed i installed into Gnuwin Directory.
Then i extracted the PoDoFo-Source and created there a directory called build and changed to it. From there i run cmake this way:
cmake -G "MinGW Makefiles" -DCMAKE_INCLUDE_PATH=C:\gnuwin32\include -DCMAKE_LIBRARY_PATH=C:\gnuwin32\lib -DPODOFO_BUILD_SHARED:BOOL=FALSE ..
Here are no erros and everything works fine and as expected. Then i run mingw32-make to build the library but then i got the error above which has todo with the stricmp-function.
So how can i fix this problem? Any solutions? thanks!

How to use a .rc file?

I haven't used a .rc file yet. I was looking for how to set the filename/version/product name etc of a Qt assembly file, found this. I created an empty file named resources.rc and the version.h header and added in the .pro file RC_FILE = resources.rc. But when I went to build the application I get this error:
gcc: error: Message\: No such file or directory
gcc: error: Kernel: No such file or directory
windres: preprocessing failed.
Makefile.Release:158: recipe for target 'release/resources_res.o' failed
mingw32-make[1]: *** [release/resources_res.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/jack/Desktop/foo/build-Message Kernel-Desktop_Qt_5_5_0_MinGW_32bit-Release'
mingw32-make: *** [release] Error 2
makefile:34: recipe for target 'release' failed
00:43:58: The process "C:\Qt2\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Message Kernel (kit: Desktop Qt 5.5.0 MinGW 32bit)
When executing step "Make"
How do I fix this?
Found the error! Hope this is useful to anyone!
My project name contains white spaces, by looking carefully at compiler output tab (in Qt creator) I noticied that the path passed to windres utility wasn't surrounded by quotes (as a path with spaces in name should be) causing the error:
gcc: error: Message: No such file or directory
So I just removed the spaces from project name and this worked just fine.
Here's the Qt version this is happening:

Target Architecture not defined error

I am developing a filter driver and encountering following error:
fatal error C1189: #error : "No target architecture defined"
1>Compiling...
1>miniport.c
1>c:\winddk\7600.16385.0\inc\ddk\wdm.h(14197) : fatal error C1189: #error : "No target architecture defined"
1>protocol.c
1>c:\winddk\7600.16385.0\inc\ddk\wdm.h(14197) : fatal error C1189: #error : "No target architecture defined"
1>vwifi.c
1>c:\winddk\7600.16385.0\inc\ddk\wdm.h(14197) : fatal error C1189: #error : "No target architecture defined"
1>Generating Code...
1>Build log was saved at "file://e:\DriverMiniport\checked\BuildLog.htm"
1>DriverMiniport - 3 error(s), 0 warning(s)
You need to configure the target (x86, x64 etc.) for the DDK compiler. It should be done by running the setenv.bat script (found in the DDK) with the desired parameters. Read more here: http://technet.microsoft.com/en-us/subscriptions/ff554139(v=vs.85).aspx
right click solution and go to command line option C/C++ and add /D X86 in Additional options and apply. /D under score X86 under score...

Qt5 build with mingw-builds error _MCW_EM was not declared in this scope

the error:
..\..\corelib\tools\qlocale_tools.cpp: In function 'char* qdtoa(double, int, int
, int*, int*, char**, char**)':
..\..\corelib\tools\qlocale_tools.cpp:2257:25: error: '_MCW_EM' was not declared
in this scope
..\..\corelib\tools\qlocale_tools.cpp:2257:33: error: '_MCW_DN' was not declared
in this scope
..\..\corelib\tools\qlocale_tools.cpp:2257:41: error: '_MCW_RC' was not declared
in this scope
Makefile.Release:5718: recipe for target 'tmp/obj/release_shared/qlocale_tools.o
' failed
mingw32-make[5]: *** [tmp/obj/release_shared/qlocale_tools.o] Error 1
mingw32-make[5]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools/bootstrap'
Makefile:33: recipe for target 'release' failed
mingw32-make[4]: *** [release] Error 2
mingw32-make[4]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools/bootstrap'
Makefile:41: recipe for target 'sub-tools-bootstrap-make_first' failed
mingw32-make[3]: *** [sub-tools-bootstrap-make_first] Error 2
mingw32-make[3]: Leaving directory 'C:/qt5/2012.11/qtbase/src/tools'
Makefile:50: recipe for target 'sub-tools-make_first' failed
mingw32-make[2]: *** [sub-tools-make_first] Error 2
mingw32-make[2]: Leaving directory 'C:/qt5/2012.11/qtbase/src'
Makefile:39: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'C:/qt5/2012.11/qtbase'
makefile:51: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2
Info:
windows 7 x64 pro sp1
MinGW version
Qt5 from git
Environment variables:
C:\Python33\;C:\Perl64\site\bin;C:\Perl64\bin;C:\mingw\bin;C:\Program
Files (x86)\Programming\Git\cmd;C:\Program Files
(x86)\Programming\Git\bin
Old Environment variables:
C:\Python33\;C:\Perl64\site\bin;C:\Perl64\bin;C:\Program Files
(x86)\AMD APP\bin\x86_64;C:\Program Files (x86)\AMD
APP\bin\x86;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\SystemTools\ATI Technologies\ATI.ACE\Core-Static;
C:\Program Files (x86)\Programming\Java\jre7\bin;C:\Program Files
(x86)\Programming\Windows Kits\8.0\Windows Performance
Toolkit\;C:\cygwin\bin\;C:\MinGW\bin\;C:\Program Files\Microsoft\Web
Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET
Web Pages\v1.0\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\;C:\Program
Files\Programming\doxygen\bin;C:\Program Files
(x86)\Programming\Git\cmd;C:\Program Files (x86)\Programming\Git\bin
Configure options I use (configuration seems to work fine, no errors):
-debug-and-release -opensource -confirm-license -opengl desktop -nomake demos -nomake examples -nomake tests
make command (dah): mingw32-make
any help to how to resolve this will be much grateful!
edit1: I did some more research and it's seems to be something related to OpenGL, but nothing on how to resolve this.
edit2: I configure with -no-opengl and run mingw32-make, got the same error so, need more ides here.
edit 3: if I change this line
_control87(oldbits, _MCW_EM|_MCW_DN|_MCW_RC);
in qlocale_tools.cpp to
_control87(oldbits, MCW_EM);
it's run until I get this error:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lQt5Cored0
collect2.exe: error: ld returned 1 exit status
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -lQt5Cored0
That was due to a bug in Qt’s source code itself, the bug sneaked into the Git repo because the developer tested it on MSVS, but didn’t realize that MinGW behaved differently. It has been fixed now (BTW because of that I did manage to compile Qt5 at the time with VS2012 command prompt); so if you fetch the latest code from Git it will work fine.

Resources