Build Azure Data Factory Project using TFS Build Server 2013 - visual-studio-2013

I have Data factory project in my solution and now in the process of creating a build definition.
When the build server starts building the solution it gives an exception saying that the path C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets was not found. I have already installed the extensions on the build server but the above files go and sit in my AppData folder.
How can I build the Data factory project using TFS build definition?
PS> I am using TFS 2013 server and Visual studio ultimate 2013 is also installed on the build server.
EDIT
Even when I use msbuild from the command line the build fails with the below error
"C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj" (default target) (1) ->
(JsonCompilerTarget target) ->
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: The "ADFCompilerTask" task failed unexpectedly.\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: System.AggregateException: One or more errors occurred. ---> System.ArgumentNullException: Value cannot be null.\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: Parameter name: source\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.Common.VSAuthoring.VersionCenter.GetDefault()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.get_ProjectVersion()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.<ValidateConfigFiles>d__1b.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: --- End of stack trace from previous location where exception was thrown ---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.<ValidateJsons>d__7.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: --- End of stack trace from previous location where exception was thrown ---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.WindowsAzure.DataFactoryStudio.DataFactoryProject.ProjectSystem.ADFCompilerTask.<ExecuteAsync>d__2.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: --- End of inner exception stack trace ---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.Execute()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: ---> (Inner Exception #0) System.ArgumentNullException: Value cannot be null.\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: Parameter name: source\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.Common.VSAuthoring.VersionCenter.GetDefault()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.get_ProjectVersion()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.<ValidateConfigFiles>d__1b.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: --- End of stack trace from previous location where exception was thrown ---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.VSAuthoring.SDK.BuildSystem.JsonCompilerTask.<ValidateJsons>d__7.MoveNext()\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: --- End of stack trace from previous location where exception was thrown ---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: at Microsoft.WindowsAzure.DataFactoryStudio.DataFactoryProject.ProjectSystem.ADFCompilerTask.<ExecuteAsync>d__2.MoveNext()<---\r [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]
C:\Users\myusername\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0\DataFactory.targets(35,5): error MSB4018: [C:\Builds\103\mysolutiion\BuildDefinition\src\DataFactory\AdfApp\AdfApp.dfproj]

Okay, I could reproduce your issue on my side. Just create an Empty Data Factory Projectand queue build:
The error message indicates the issue. Right click the project and Unload the project and edit the .dfproj, you'll find the such path in declaration:
In my environment, DataFactory.targets is under C:\Users\username\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0, NOT in C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft\DataFactory Tools for Visual Studio\MsBuild\1.0. Try to change the path, the issue should go away.

I had the same problem, I didn't fix my particular issue, but perhaps it will fix your issue. I added the DataFactory.targets to the Dependencies folder in the solution and referenced it in the .dfproj file. Hope this helps!

Related

"The XamarinTelemetry task failed unexpectedly" on second build

With the latest VS preview (VS 17.3 Preview 3), with both Android and iOS, building my application works the first time I build it, but the second time it fails with
The "XamarinTelemetry" task failed unexpectedly.
Looking at the logs I see this:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: The "XamarinTelemetry" task failed unexpectedly.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: File name: 'Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.GetFaultEventBucketFilterJson(List`1 bucketFilters)
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySessionSettings.ToString()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.VisualStudio.Telemetry.TelemetrySession.SerializeSettings()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Xamarin.Common.Tasks.Telemetry.GetSession(IBuildEngine4 buildEngine, String vsTelemetrySession) in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\Telemetry.cs:line 62
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Xamarin.Common.Tasks.XamarinTelemetry.Execute() in D:\a\_work\1\s\src\MSBuild\Xamarin.Common.Tasks\XamarinTelemetry.cs:line 31
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018:
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: WRN: Assembly binding logging is turned OFF.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: Note: There is some performance penalty associated with assembly bind failure logging.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018: To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Xamarin\Xamarin.Sdk.targets(138,9): error MSB4018:
The only workaround I've found is to clean the entire solution and rebuild, which succeeds, but then fails again the next time I try to build.
Has anyone found a solution to this?
First off, don't shoot the messenger here..
UPDATE: August 16, 2022
According to Visual Studio v17.3.1's Release Notes, this issue has been resolved. However, if not, there's still the following
As per the workaround thread on Visual Studio's dev community thread:
Open, Xamarin.Sdk.targets in Admin Mode (I use, Notepad++)
C:\Program Files\Microsoft Visual Studio\2022\Preview\Msbuild\Xamarin\Xamarin.Sdk.targets
Comment out the <XamarinTelemetry ... />
Save file and rebuild the solution.
Though it does work in the interim, please forward your official feedback on the official VS Developer Community thread in the link below.
https://developercommunity.visualstudio.com/t/Unexpecter-error-of-task-Xamarin-Teleme/10096527
https://developercommunity.visualstudio.com/t/XamarinTelemetry-task-failed-unexpectedl/10100083
There are several config files in the VS installation which reference 13.0.0.0
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
I replaced these with
<bindingRedirect oldVersion="0.0.0.0-13.0.1.0" newVersion="13.0.1.0" />
and was able to build.
It seems that the 13.0.0.0 is not publicly available as nuget package...
In Visual Studio 17.3.0, I right-clicked on the projects and selected "Clean".
Then I tried again to right-click the project and selected "Build" and it worked, the "The XamarinTelemetry task failed unexpectedly" error did not occur.
This is in a solution that contains a .NET Standard 2.0 library that references Xamarin Forms and the project in question is an ASP.NET Core 3.1 API referencing the library.
There are fixed minor-version editions of VS available, for example "2022 LTSC 17.2".
Install it parallel to your current VS or exclusively.
https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history#evergreen-bootstrappers
Direct downloads:
Enterprise 2022 - 17.2 LTSC
Professional 2022 - 17.2 LTSC
Community is not available
I prefer this over the modification of your 17.3 installation.
It also appears with a different name, so it's easy to distinguish.
start menu
VS installer
I experienced this today and all I did was rebuild the solution, clicked the "save all", closed the application and opened it again but it did not work. I rebuilt the project but it did not work either. So again, I just repeat the process by closing the visual studio, rebuild and run 2 times (also I went to the error file just viewed it) and it works fine. I don't know what differences it made but it works when you repeat the process.
Edit: The error is still repeating. I just use the Factory Reset when the error occurs.
I had the exact same issue with my Xamarin forms solution, after upgrading from 17.2 to 17.3.
Today I installed 17.3.2. A dozen builds later and it seems that the issue has been addressed.

Link error using Visual Studio 2010 command prompt

When building Openssl source code using Visual Studio x64 Win64 command prompt(2010) getting error:
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\amd64\link.EXE"' : return code '0x463' Stop.
How do I resolve this issue?
Thanks in Advance.

how to build Qt5 with qtwebkit on Windows with MSVC 2008 - leveldb can't find stdint.h

On a Windows 7 x64 box:
I installed Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1
I downloaded and unzipped Qt5.4.0 source from the "Source packages and Other releases" section of http://www.qt.io/download-open-source/#
I built ICU 54.1 from source and installed it, per http://qt-project.org/wiki/Compiling-ICU-with-MSVC.
I created a command prompt shortcut per http://doc.qt.io/qt-5/windows-building.html.
I added stuff to the command prompt per http://qt-project.org/wiki/Building_Qt_5_from_Git and the Usage section of http://qt-project.org/wiki/Compiling-ICU-with-MSVC.
So my qt5vars.cmd is:
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=
I updated qtwinextras\src\winextras\winshobjidl_p.h per Compiling Qt 5.3.2 + VS2008 + SDK7.1 error SHARDAPPIDINFOLINK.
Per https://groups.google.com/forum/#!topic/theano-users/JReP5_Ligu4 and C99 stdint.h header and MS Visual Studio, I copied stdint.h from C:\Program Files\Microsoft Visual Studio 10.0\VC\include on another machine, and pasted it into C:\Qt\qt540\qtwebkit\Source\WTF\wtf. I commented out the declaration of WCHAR_MIN, and copied that modified stdint.h to c:\qt\qt540\qtwebkit\source\javascriptcore\runtime.
With that setup, from the qt5vars.cmd prompt above, I configured Qt with:
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
Then ran nmake. I get a bunch of errors that leveldb can't find 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.
There is a stdint.h in C:\Qt\qt540\qtwebkit\Source\ThirdParty\leveldb\port\win, but copying that file or my modified stdint.h to leveldb\db and leveldb\include\leveldb makes no difference - I get the same errors when building Qt.
What do I need to do to build qtwebkit with Qt, or at least get past this leveldb sdtint.h issue?
OK, I'm a dummy. Just needed to copy stdint.h to C:\Program Files\Microsoft Visual Studio 9.0\VC\include instead of to the path of every file that complains. Additionally, I commented out the declaration of WCHAR_MIN in stdint.h to avoid tons of warnings about redeclaring it.
Then using the configure statement in the original question, Qt5.4.0 built successfully, including qtwebkit! Took 11 hours to build, but it worked!

How to compile Qt with Microsoft Visual Studio

I created a Qt programme, I can compile it without problem manuelly with Visual Studio (using Add-In) but when I try to compile it with coding I have a problem. The problem is
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
Done Building Project "C:\foo.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\foo.vcxproj" (default target) (1) ->
(CustomBuild target) ->
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
0 Warning(s)
1 Error(s)
How can I solve the problem, please help me…
Error:
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 03.12.2013 11:35:49.
Project "C:\foo.vcxproj" on node 1 (default targets).
InitializeBuildStatus:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
Done Building Project "C:\foo.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\foo.vcxproj" (default target) (1) ->
(CustomBuild target) ->
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. [C:\foo.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.14
This message:
The system cannot find the path specified.
in the current context tells me that the build program can't find moc.exe and uic.exe. You need to add C:\Qt\5.1.1\msvc2012_64\bin or whatever directory contains qmake.exe, moc.exe, uic.exe and other Qt programs to PATH by doing:
set PATH=C:\Qt\5.1.1\msvc2012_64\bin;%PATH%

cmath generates syntax errors on build in Visual studio 2010 (ANSI C) [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
i've got to do a bit of pure ANSI C and i'm trying to do it in Visual Studio 2010. Problem is; regardless of setting the compiler to pure C and flipping the \Za compiler switch to disable windows extensions - the code just won't compile:
#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
cout << M_PI;
return 0;
}
This is in a file called Test.c - there are no precompiled headers and everything should be fine, but this is what the compiler spits out:
1>ClCompile:
1> Test.c
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'acosf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2061: syntax error : identifier 'asinf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(19): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'atanf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'atan2f'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2061: syntax error : identifier 'ceilf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(20): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'cosf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'coshf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2061: syntax error : identifier 'expf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(21): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'fabsf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'floorf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2061: syntax error : identifier 'fmodf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(22): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'frexpf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'ldexpf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2061: syntax error : identifier 'logf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(23): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'log10f'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'modff'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2061: syntax error : identifier 'powf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(24): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sinf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sinhf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2061: syntax error : identifier 'sqrtf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(25): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2061: syntax error : identifier 'tanf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2061: syntax error : identifier 'tanhf'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(26): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2061: syntax error : identifier 'acosl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2061: syntax error : identifier 'asinl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(28): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'atanl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'atan2l'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2061: syntax error : identifier 'ceill'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(29): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'cosl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'coshl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2061: syntax error : identifier 'expl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(30): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'fabsl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'floorl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2061: syntax error : identifier 'fmodl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(31): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'frexpl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'ldexpl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2061: syntax error : identifier 'logl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(32): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'log10l'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'modfl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2061: syntax error : identifier 'powl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(33): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sinl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sinhl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2061: syntax error : identifier 'sqrtl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(34): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2061: syntax error : identifier 'tanl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2061: syntax error : identifier 'tanhl'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(35): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(37): error C2061: syntax error : identifier 'abs'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(37): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2061: syntax error : identifier 'acos'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2061: syntax error : identifier 'asin'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(39): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'atan'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'atan2'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2061: syntax error : identifier 'ceil'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(40): error C2059: syntax error : ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(41): error C2061: syntax error : identifier 'cos'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath(41): fatal error C1003: error count exceeds 100; stopping compilation
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.17
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm not that experienced with VS and C, but i've looked around and nothing I do seems to work. I'm guessing it'll be something silly. Thanks in advance
(Note: this same error occurs with absolutely no references to any math libraries)

Resources