Building 32-bit Detours library - 32-bit

I'm using Detours library from microsoft, and I was using the 32bit version (which is free). I'm now on a 64-bit installation of windows 7 and I can't seem to compile Detours with nmake.
Here is the error:
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
cd "C:\Program Files (x86)\Microsoft Research\Detours Express 2.1\src"
Building for 64-bit X64.
if not exist "..\include" mkdir "..\include"
if not exist "..\lib" mkdir "..\lib"
if not exist "..\bin" mkdir "..\bin"
cl /LD /nologo /W4 /WX /Zi /MTd /Gy /Gm- /Zl /O1 /DWIN32_LEAN_AND_MEAN /
D_WIN32_WINNT=0x403 /D_WIN64 /DDETOURS_X64=1 /D_AMD64_ /Wp64 /Fe..\bin\detoured.
dll /Fd..\bin\detoured.pdb detoured.cpp /link /release /machine:amd64 /base:0xf
000000 /incremental:no /subsystem:console /entry:DllMain /implib:..\lib\detoure
d.lib /export:Detoured kernel32.lib detoured.res
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be
removed in a future release
detoured.cpp
c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourc
eannotations.h(17) : error C2371: 'size_t' : redefinition; different basic types
detoured.cpp : see declaration of 'size_t'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(305) : warning C
4311: 'type cast' : pointer truncation from 'const void *' to 'unsigned long'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(314) : warning C
4311: 'type cast' : pointer truncation from 'const void *' to 'long'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\basetsd.h(323) : warning C
4312: 'type cast' : conversion from 'unsigned long' to 'void *' of greater size
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\winnt.h(12935) : error C38
61: '__readfsdword': identifier not found
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\nmake.exe"' : return code '0x2'
Stop.
As you see, it's trying to compile for 64-bit. How can I force nmake to build for 32bits?
Thanks,
Dave

Next time, simply set the DETOURS_TARGET_PROCESSOR environment variable. Valid values are x86, AMD64 and IA64. (The Express version of Detours only supports x86.)

I needed windows SDK to compile. Simply google windfows SDK, download & install, run the Windows SDK console in admin mode and compile!
If installing SDK on windows 7 gives errors, here is the solution:
http://support.microsoft.com/kb/2717426/de
This issue occurs when you install the Windows 7 SDK on a computer that has a newer version of the Visual C++ 2010 Redistributable installed. The Windows 7 SDK installs version 10.0.30319 of the Visual C++ 2010 Redistributable.
To resolve this issue, you must uninstall all versions of the Visual C++ 2010 Redistributable before installing the Windows 7 SDK. You may have one or more of the following products installed:
Microsoft Visual C++ 2010 x86 Redistributable
Microsoft Visual C++ 2010 x64 Redistributable

Related

Error compile Visual Studio 2019 Project dll with MSBuild 2019, obfuscating with Eazfuscator NET 2018.2 in TeamCity 2020.2.2

I have this error when TeamCity Build Step compile with obfuscating a Visual Studio dll Project with MSBuild:
EXEC: error: Error occurred during processing of input file '.dll' -> Cannot load file or assembly 'zx_2cba06c4237a413ea1e8116e71ad61dc, PublicKeyToken = 6205972ab2f0fc68' or one of its dependencies. The system cannot find the specified file. C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets (5473,5): error MSB3073: The command "if /I "Release" == "Release" "C:\Program Files (x86)\Eazfuscator.NET\Eazfuscator.NET.exe" "E:\Builds\MyDll\bin\Release\MyDll.dll" --msbuild-project-path "E:\Builds\MyDll\MyDll.csproj" --msbuild-project-configuration "Release" --msbuild-project-platform "AnyCPU" --msbuild-solution-path "*Undefined*" -n --newline-flush -v 2018.2" exit with code 1.
Eazfuscator-.NET-2018.2.2 is not compatible with MSBuild 2019, the solution is use Eazfuscator-.NET-2019.1 as minimun version.

Visual Studio Build Tools fails to recognize "net5.0-windows"

Is it possible to build a .NET 5 project with the Visual Studio Build Tools? Or is my installation not working?
Note: I can't use the dotnet.exe, since i have to build with the WiX-Toolset.
Installed:
Microsoft (R)-Build-Engine, Version 16.7.0+b89cb5fde für .NET Framework
.NET SDK (gemäß "global.json"):
Version: 5.0.100
Commit: 5044b93829
msbuild.exe used from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
Error:
C:\Program Files\dotnet\sdk\3.1.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(93,5): error NETSDK1013: Der TargetFramework-Wert "net5.0-windows" wurde nicht erkann
t. Unter Umständen ist die Schreibweise nicht korrekt. Andernfalls müssen die Eigenschaften TargetFrameworkIdentifier und/oder TargetFrameworkVersion explizit angegeben werden. [C:\GitLab-Runner\builds
\mq82bps2\0\capps\developer\mfinder\MFinder\MFinder.csproj]
Also the msbuild.exe searches in the path C:\Program Files\dotnet\sdk\3.1.403\ and not C:\Program Files\dotnet\sdk\5.0.100\. Any hints on that?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
If you want to use Build Tool, you should note that .NET 5.0 is released since 16.8. So you should update your build tool to 16.8.x and then you can build .NET 5.0 projects.
Also, if you just use command line, you can directly download .NET 5.0 Sdk and then use dotnet build.
And if you installed .NET 5.0 and want to use VS IDE, you should also update VS to 16.8.x.

nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION) when building tensorflow with bazel

I am trying to build Tensorflow 1.14.0 dll. I am using bazel 0.24.1 to do it. I also use cuDNN 7.1.4 and CUDA 9.0.I want it to use Visual C++ Build Tools 2015, but when running bazel to build dll:
bazel build --config=cuda tensorflow:tensorflow.dll,
by default in LIB and INCLUDE variables path C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023 is set. I then get bunch of errors like C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include\xutility(796): error: expression must have a constant value. Build failes with error: nvcc error : 'cicc' died with status 0xC0000005 (ACCESS_VIOLATION).
I tried to set:
set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
but error still occurs. Any ideas?
I finally got a solution. You can force correct paths by setting following environment variables:
CPU_COMPILER = ('C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe')
GCC_HOST_COMPILER_PATH = ('C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe')
just before running
bazel build --config=cuda tensorflow:tensorflow.dll
in commandline. It's best to do it in Powershell, as there is a problem with spaces/apostrophes in paths when using Windows commandline.

MSBuild returns non-zero errorlevel in CMD and Visual Studio Developer Command Prompt, but not PowerShell

I'm having an issue where when I try to run builds using MSBuild, I get a non-zero errorlevel (-1073741819). While researching this issue, I noticed I got this error level if I ran msbuild in the Command Prompt or VS2017 Developer Command Prompt, but not in PowerShell.
In PowerShell, if I run msbuild /? I get the normal usage information. However, in Command Prompt or VS2017 Develper Command Prompt, msbuild /? produced the same error code as above with no output. For example, in the Visual Studio Developer Command Prompt I see:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.5
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
C:\Windows\System32>msbuild /?
C:\Windows\System32>echo %errorlevel%
-1073741819
However, in PowerShell I see this:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\WINDOWS\system32> msbuild /?
Microsoft (R) Build Engine version 15.7.180.61344 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
<<... Detailed flag options displayed here ...>>
According to PowerShell Get-Command, it's using msbuild.exe from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe. Setting the /verbosity: flag doesn't seem to change the output.
In the event log, I'm seeing the error with the error: Exception code: 0xc0000005.
My Path:
C:\tools\ruby23\bin
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\windows\system32
C:\windows
C:\windows\System32\Wbem
C:\windows\System32\WindowsPowerShell\v1.0\
C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\
C:\Program Files\Microsoft SQL Server\130\DTS\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
C:\Program Files (x86)\NuGet
C:\Program Files\Microsoft\Web Platform Installer\
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\WINDOWS\System32\WindowsPowerShell\v1.0\
C:\WINDOWS\System32\OpenSSH\
C:\Program Files\dotnet\
C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\
C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\
C:\ProgramData\chocolatey\bin
C:\Program Files\Git\cmd
C:\Program Files\OpenSSH-Win64
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer
C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools
C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer\
C:\Program Files (x86)\Microsoft Team Foundation Server 2013 Power Tools\Best Practices Analyzer\
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin
C:\Users\MyUserName\AppData\Local\Microsoft\WindowsApps
C:\Users\MyUserName\AppData\Local\atom\bin
C:\Program Files\Collaborator Client
MSBuild returns non-zero errorlevel in CMD and Visual Studio Developer Command Prompt, but not PowerShell
It seems your Visual Studio Developer Command Prompt has not been initialized successfully. You can try to execute VsDevCmd.bat in the Visual Studio Developer Command Prompt:
Location: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools
If this .bat can not be executed successfully, you can try to repair or reinstall the Visual Studio.
Update:
I'm seeing an exception code for msbuild in the Event log: Exception
code: 0xc0000005. Google hasn't produced much unfortunately
It seems the exception code 0xc0000005 is related to access violation. When you execute your command can you switch to use admin privilege? You may need to check the permission of your account. And you also need to check if Virus scanner is disabled.
Hope this helps.

which Qt environnement do I install to compile and run qtify project?

I would like to compile and run the qtify project to see a consequent exemple using desktop components.This project use:
import QtQuick 2.0 // I must have Qt 5 or later
import QtDesktop 1.0 // I search an extension which compile with Qt 5.1
I have just installed Qt 5.1.alpha this morning, and I would like to install a compatible version of "Qt-desktop-components" wich support QtDesktop 1.0.
My QtCreator version is 2.7.0.
I tried to install this version of qtdesktopcomponent but when I compile with:
`qmake && nmake install`
I've got this error: (This comand is used in Visual Studio Command Prompt (2010) )
C:\Users\Luciole\Downloads\desktop-component\qtquickcontrols>qmake && nmake
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -
f Makefile.Debug
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -DUNIC
ODE -DWIN32 -DQT_NO_EXCEPTIONS -DQT_GUI_LIB -DQT_CORE_LIB -I"." -I"C:\Users\Luci
ole\Downloads\qt-everywhere-opensource-src-5.1.0-alpha\qtbase\include" -I"C:\Use
rs\Luciole\Downloads\qt-everywhere-opensource-src-5.1.0-alpha\qtbase\include\QtG
ui" -I"C:\Users\Luciole\Downloads\qt-everywhere-opensource-src-5.1.0-alpha\qtbas
e\include\QtCore" -I".moc\debug_shared" -I"C:\Users\Luciole\Downloads\qt-everywh
ere-opensource-src-5.1.0-alpha\qtbase\mkspecs\win32-msvc2010" -Fo.obj\debug_shar
ed\ #C:\Users\Luciole\AppData\Local\Temp\nm54D2.tmp
main.cpp
tools\qmlwidget\main.cpp(43) : fatal error C1083: Cannot open include file: 'QtQ
ml': No such file or directory
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.
The value of my PATH is:
C:\Users\Luciole\Downloads\qt-everywhere-opensource-src-5.1.0-alpha\qtbase\qmake;C:\Users\Luciole\Downloads\qt-everywhere-opensource-src-5.1.0-alpha\qtbase\bin;C:\Qt\qtcreator 2.7.0\bin;C:\Git\cmd;C:\Python27;C:\Ruby200;C:\Perl64\site\bin;C:\Perl64\bin;
And I've verified: I don't have "QtQml.h" in my Qt.5.1.alpha installation.
What do you think about this? Can you help me to resolve this bug, or can you tell me which version of Qt and qtdesktopcomponent to use? (with the link of the repository please)
Please refer this link, You don't have to install Qt Desktop, it is included in the package. Name has been change from Qt Desktop Components to Qt Quick Controls
Edit:
Documentation snapshot can find from here