QT Creator Build Error: failure during conversion to COFF - qt

error: LNK1123: failure during conversion to COFF: file invalid or corrupt
I'am getting this error every time I try to build any project on my Qt Creator.
I have VS2010 installed and the compiler version set to MSVC C++ compiler 10.0(x86).
I have Qt 5.2.1 MSVC2010 32bit OpenGL.

This error appears because you have installed VS 2012 after you have actually installed VS 2010 in your system.
It can be solved if you install SP1 for VS2010.
An other solution is to go to
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe
and check the version of cvtres.exe. If the date is 03/18/2010 go to
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cvtres.exe
and copy cvtres.exe then replace it On
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cvtres.exe

This error may occur when.Net Framework updated to 4.5.x. To resolve this error
You can change project properties as "Enable Incremental Linking -> "No (/INCREMENTAL:NO)".
Or, uninstall the .Net Framework 4.5.x and install .NET Framework 4.

Related

Biztalk 2020 Build fails with AddBizTalkHiddenReferences after adding certain nuget packages

Reproduction steps:
Stack: Windows 10, Visual Studio 2019 professional, BizTalk Server 2020 developer edition CU1.
In Visual Studio create a new Biztalk Server Project
Manage Nuget Package, Add a nuget package. pick one:
Known to break the build
autofac 6.0, 6.1, 6.2
nodatime 3.0.5
Azure.Storage.Blobs 12.9.1
Known to not break the build
autofac 5.2
many others I tested.
F6 (Build) or run msbuild
As far as my testing was going, whenever the nuget packages directly list a variant with a .net framework as a dependency, it works. Listing only .net standard and .net 5 as a dependency, as in the list above, fails the buil.
actual error:
PS C:\code\autofacRepro> msbuild
Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 8/24/2021 3:01:10 PM.
Project "C:\code\autofacRepro\autofacRepro.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\code\autofacRepro\autofacRepro.sln" (1) is building "C:\code\autofacRepro\autofacRepro.btproj" (2) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: The "AddBizTalkHiddenReferences" task failed unexpectedly. [C:\code\autofacRepro\autofacRepro.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: System.ArgumentException: String cannot have zero length. [C:\code\autofacRepro\autofacRepro.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: at System.Reflection.AssemblyName..ctor(String assemblyName) [C:\code\autofacRepro\autofacRepro.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: at Microsoft.VisualStudio.BizTalkProject.BuildTasks.AddBizTalkHiddenReferences.GetAssemblyNamesFromItems(ITaskItem[] items) [C:\co
de\autofacRepro\autofacRepro.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: at Microsoft.VisualStudio.BizTalkProject.BuildTasks.AddBizTalkHiddenReferences.Execute() [C:\code\autofacRepro\autofacRepro.btproj
]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C:\code\autofacRepro\autofacRep
ro.btproj]
C:\Program Files (x86)\MSBuild\Microsoft\BizTalk\BizTalkCommon.targets(190,9): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\code\autofacRepro\autofacRepro.btproj]
Done Building Project "C:\code\autofacRepro\autofacRepro.btproj" (default targets) -- FAILED.
Done Building Project "C:\code\autofacRepro\autofacRepro.sln" (default targets) -- FAILED.
Build FAILED.
A repro zip package is available in this github issue. (at first I thougt, it was a special issue with autofac, but it is not)
My old stack (windows server 2016, visual studio 2015, biztalk 2016) is not affected. We are using autofac 6.1 in biztalk projects there without any issue.
I feel like this is a BizTalk bug but I am not smart enough to find the way Microsoft allows reporting it.
So finally the question is, is there a workaround or a bugfix?
I've had this with one of my own packages. This package was targeting .NET Standard 2.0. I had to add .NET Framework 4.8 (in my case) specifically as a target framework in the class library and recreate the package for it.
For public packages, you may want to create a PR or make a fork to include targeting of .NET Framework. Your BizTalk project then needs to reference the .NET Framework assembly rather than the .NET Standard one.

Visual studio 2017 installation issue on windows 8/8.1

We are not getting core 2.0 template after installation Vs2017 community edition.
Under the Environment Variable the Path was setup wrong.
'C:\Program Files (x86)\dotnet' removed
'C:\Program Files\dotnet' set

MSBuild missing target WebPublish

I am trying to publish a website at our CI server.
For some reason target WebPublish works when building with MSBuild 12.0 but not with MSBuild 14.0.
I can test it with following command: msbuild My.Web.csproj /t:WebPublish
It works with 12.0. MSBuild 14.0 gives error:
Build FAILED.
R:\My.Web\My.Web.csproj" (WebPublish target) (1) ->
R:\My.Web\My.Web.csproj : error MSB4057: The target "WebPublish" does not exist in the project.
0 Warning(s)
1 Error(s)
I have Visual Studio 2012 and 2015 installed. Is there something else I have to install in the CI server?
For anyone running into this problem currently, there are some alternative solutions posted on the following stack overflow question
The thing that fixed it for me was the "Web" and "Web Applications" folders found in the MSBuild directory for the version of visual studio that matched what I built my project in. In my case this was
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0
You have to install "Web Developer Tools". You can do it from "Programs and Features" and repairing Visual Studio 2015.

How to build a project in qt 5.2.1 for amd64 (setup cl.exe and missing mspdb110.dll file)?

I have installed qt 5.2.1 and Visual Studio 2012 in Windows 7 x64 (I have codepage 1251 if it matters). I use vs11 compiler.
Firstly I tried to run 'Rebuild all' action and I have received an error connected with cl.exe.
Then I added the path to vs11/bin to PATH variable (where cl.exe file is located; strange but it is in Program Files x86 folder) and have received the error: mspdb110.dll is missing. What should I do next? How to build the project?
Add to PATH path of directory with this dll. It's in something like C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64. If you have not such file in entire system, I guess you should reinstall Visual Studio.

Qt Creator issue : Cannot open include file: ‘windows.h’

I have installed ‘Qt Creator 2.4.1 Based on Qt 4.7.4 (32 bit)’ on Windows 7 with Visual studio 2008. But on creating the basic project am getting following error :
c:\qtsdk\desktop\qt\4.8.1\msvc2008\mkspecs\win32-msvc2008\..\win32-msvc2005\qplatformdefs.h:67:
error: C1083: Cannot open include file: 'windows.h': No such file or directory
Also I checked the windows.h its present in following location : C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\
I would like to mention that I can’t use the MinGW target due to project specifications.
Requesting everyone to help me out of this situation.
in Qt Creator, Tools--Options, Build&Run, Kits, choose a kit and edit its attributes, change the Compiler from "Microsoft Windows SDK ..." to "Microsoft Visual C++ Compiler 9.0 (x86)".
I solved the same problem by this way.
Check Qt creator's Projects/Build Environment and edit variables
(INCLUDE, LIB, OSINCLUDES, OSLIBRARIES, PROGRAMFILES, SDKDIR, SDKTOOLS, WINDOWSSDKDIR)
that contains Windows SDK 7.1 path(C:\Program Files **(x86)\Microsoft SDKs\Windows\v7.1**).
Maybe Windows SDK 7.1 is installed at "C:\Program Files\Microsoft SDKs\Windows\v7.1"

Resources