Unreal Engine 4 installed build fails - build
I am having trouble making an installed build from the Unreal Engine 4.18 from source. The goal is to be able to make slight changes to the engine and make a build that is easy to deploy to others.
The process worked on one machine and now I am trying to do the same thing on another machine and it fails.
The process I am following is described here in the UE4 documentation:
https://docs.unrealengine.com/latest/INT/Programming/Development/InstalledBuildReference/index.html
I am running the command with the Unreal BuildGraph:
RunUAT.bat BuildGraph -target="Make Installed Build Win64" -script=Engine/Build/InstalledEngineBuild.xml -clean -set:HostPlatformOnly=true
After running for about 10mins it fails with the output below.
My specs are Windows 10 and Visual Studio 2017 (I tried 2015 as well). Visual studio was installed with the "Game development with C++" option.
I searched the internet for days now and asked this question on answerhub, but no success so far.
I would be thankful for suggestions in any way.
Here is the output:
****** [3/11] Compile UE4Editor Win64
Reading local file list from C:\Program Files\UnrealEngine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Win64\Tag-Compile UnrealHeaderTool Win64.xml
Reading local file list from C:\Program Files\UnrealEngine\Engine\Saved\BuildGraph\Update Version Files\Tag-Update Version Files.xml
Reading shared manifest from C:\Program Files\UnrealEngine\Engine\Saved\BuildGraph\Compile UnrealHeaderTool Win64\Manifest.xml
Running: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\MSBuild.exe "C:/Program Files/UnrealEngine/Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj" /verbosity:minimal /nologo /target:Rebuild /property:Configuration=Development /property:Platform=AnyCPU
DotNETUtilities -> C:\Program Files\UnrealEngine\Engine\Binaries\DotNET\DotNETUtilities.dll
UnrealBuildTool -> C:\Program Files\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe
Took 2,9536361s to run MSBuild.exe, ExitCode=0
Running: C:\Program Files\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Editor Win64 Development -clean -NoUBTMakefiles -nobuilduht -precompile -nobuilduht -NoHotReload -ignorejunk
Using 'git status' to determine working set for adaptive non-unity build.
Took 6,0637902s to run UnrealBuildTool.exe, ExitCode=0
Running: C:\Program Files\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe UE4Editor Win64 Development -generatemanifest -nobuilduht -xgeexport -NoUBTMakefiles -nobuilduht -precompile -NoHotReload -ignorejunk
Using 'git status' to determine working set for adaptive non-unity build.
Parsing headers for UE4Editor
Running UnrealHeaderTool UE4Editor "C:\Program Files\UnrealEngine\Engine\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors
Reflection code generated for UE4Editor in 45,0421111 seconds
XGEEXPORT: Exported 'C:\Program Files\UnrealEngine\Engine\Intermediate\Build\UBTExport.000.xge.xml'
Took 92,4963793s to run UnrealBuildTool.exe, ExitCode=0
Building with 16 processes...
Unhandled Exception:
Unhandled Exception:
Unhandled Exception:
Unhandled Exception:
Unhandled Exception:
Unhandled Exception:
Unhandled Exception: Unhandled Exception: Unhandled Exception: Unhandled Exception: Unhandled Exception: Unhandled Exception:
Unhandled Exception:
Unhandled Exception: Unhandled Exception: Unhandled Exception: System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
System.ComponentModel.Win32Exception: Access Denied
at AutomationTool.ManagedProcess..ctor(String FileName, String CommandLine, String WorkingDirectory, IReadOnlyDictionary`2 Environment, String Input, ManagedProcessPriority Priority) in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ManagedProcess.cs:Zeile 307.
at AutomationTool.ParallelExecutor.BuildActionExecutor.Run() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 61.
at AutomationTool.ParallelExecutor.<>c__DisplayClass3_0.<Execute>b__1() in C:\Program Files\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ParallelExecutor.cs:Zeile 120.
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
BUILD FAILED
There isn't quite enough information on your issue to dig down on what is going on, however there are some things to check.
The Unreal Engine repository contains a pretty easy to follow setup when building from source. I couldn't find a reference to the BuildGraph you are using, I may be unaware of it's existence.
All 16 build processes have exited with the same exception from what I see - System.ComponentModel.Win32Exception: Access Denied. I would check if the user you are trying to build with has read (and possibly write access since the process will need to output files) to the location you have cloned the source to.
Hope this sets you on the right path.
Related
HOW to link or well include winrt to compile your project
fatal error: experimental/coroutine: No such file or directory this is the error the compiler gives me here's main.cpp #include <fstream> #include <iostream> #include <filesystem> #include <chrono> #include <thread> #include <winrt/windows.ui.viewmanagement.h> int main (){ bool running = true; winrt::Windows::UI::ViewManagement::UISettings Colsettings; auto coloracc = Colsettings.GetColorValue(winrt::Windows::UI::ViewManagement::UIColorType::Accent); std::cout << coloracc.B; if (!std::filesystem::exists("color.inc")) { running = false; } while (running) { std::this_thread::sleep_for(std::chrono::milliseconds(500)); std::cout << "aaaaaaaaaaa"; } } here's task.json { "version": "2.0.0", "tasks": [ { "type": "process", "label": "C/C++: g++.exe build active file", "command": "C:\\msys64\\mingw64\\bin\\g++.exe", "args": [ "-fdiagnostics-color=always", "-std=c++23", "-g", "${file}", "-I", "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt", "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$gcc" ], "group": "build", "detail": "compiler: C:\\msys64\\mingw64\\bin\\g++.exe" } ] } I guess the solution is by changing tasks.json I was surfing the web and I didn't find an article that tells me how to use winrt in vscode and thanks
{ "type": "cppbuild", "label": "C/C++: cl.exe build active file", "command": "cl.exe", "args": [ "WindowsApp.lib", "/std:c++17", "/Zi", "/EHsc", "/nologo", "/Fe:", "${fileDirname}\\${fileBasenameNoExtension}.exe", "*.cpp" ], "options": { "cwd": "${fileDirname}" }, "problemMatcher": [ "$msCompile" ], "group": "build", "detail": "compiler: cl.exe" } so I used Microsoft compiler and it works fine maybe I'll try using cmake since I guess the project will get bigger
C:\msys64\mingw64\bin\clang++.exe -std=c++17 -g *.cpp -I "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/cppwinrt" -I "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include" -I "C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt" -o "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe" In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:9: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/yvals_core.h:394: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:58: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vadefs.h:61:33: error: expected ';' after top level declarator typedef unsigned __int64 uintptr_t; ^ ; In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:9: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/yvals_core.h:394: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: C++ requires a type specifier for all declarations _CRT_BEGIN_C_HEADER ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER' __pragma(pack(push, _CRT_PACKING)) \ ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: use of undeclared identifier 'push' C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER' __pragma(pack(push, _CRT_PACKING)) \ ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:96:1: error: expected ';' after top level declarator C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER' extern "C" { ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:193:29: error: expected ';' after top level declarator typedef unsigned __int64 size_t; ^ ; C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:228:22: error: 'short wchar_t' is invalid typedef unsigned short wchar_t; ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:228:5: warning: typedef requires a name [-Wmissing-declarations] typedef unsigned short wchar_t; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:252:42: error: unknown type name 'size_t' template <typename _CountofType, size_t _SizeOfArray> ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:366:51: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'? void __cdecl __security_check_cookie(_In_ uintptr_t _StackCookie); ^~~~~~~~~ intptr_t C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here typedef __int64 intptr_t; ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:367:67: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'? __declspec(noreturn) void __cdecl __report_gsfailure(_In_ uintptr_t _StackCookie); ^~~~~~~~~ intptr_t C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here typedef __int64 intptr_t; ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:371:8: error: unknown type name 'uintptr_t'; did you mean 'intptr_t'? extern uintptr_t __security_cookie; ^~~~~~~~~ intptr_t C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:195:30: note: 'intptr_t' declared here typedef __int64 intptr_t; ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:1: error: C++ requires a type specifier for all declarations _CRT_END_C_HEADER ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:74:9: note: expanded from macro '_CRT_END_C_HEADER' __pragma(pack(pop)) ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:1: error: use of undeclared identifier 'pop' C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:74:23: note: expanded from macro '_CRT_END_C_HEADER' __pragma(pack(pop)) ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:379:18: error: expected ';' after top level declarator _CRT_END_C_HEADER ^ ; In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:13: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cstdio:12: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/stdio.h:13: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/corecrt_wstdio.h:13: C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/corecrt_stdio_config.h:35:10: error: Unsupported architecture #error Unsupported architecture ^ In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25: C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: C++ requires a type specifier for all declarations _CRT_BEGIN_C_HEADER ^ C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:9: note: expanded from macro '_CRT_BEGIN_C_HEADER' __pragma(pack(push, _CRT_PACKING)) \ ^ In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25: C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: use of undeclared identifier 'push' C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:69:23: note: expanded from macro '_CRT_BEGIN_C_HEADER' __pragma(pack(push, _CRT_PACKING)) \ ^ In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25: C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:17:1: error: expected ';' after top level declarator C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/vcruntime.h:70:9: note: expanded from macro '_CRT_BEGIN_C_HEADER' extern "C" { ^ In file included from main.cpp:2: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/fstream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/istream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ostream:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/ios:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/xlocnum:15: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iterator:11: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/iosfwd:14: In file included from C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/include/cwchar:13: In file included from C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/wchar.h:25: C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:27:5: error: unknown type name '_ino_t' _ino_t st_ino; ^ C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0/ucrt/sys/stat.h:34:5: error: unknown type name '__time32_t' __time32_t st_atime; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 1 warning and 20 errors generated. this is the error the problem clang++ has given me g++ is giving me about 447 errors so yeah I'm clueless of what I should do so I tried using cl.exe here's the compiler error cl.exe /std:c++17 /Zi /EHsc /nologo /Fe: "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe" "C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.cpp" main.cpp main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SetErrorInfo#8 referenced in function "struct winrt::hresult __cdecl winrt::impl::get_runtime_activation_factory<struct winrt::Windows::Foundation::IActivationFactory>(struct winrt::param::hstring const &,void * *)" (??$get_runtime_activation_factory#UIActivationFactory#Foundation#Windows#winrt###impl#winrt##YA?AUhresult#1#ABUhstring#param#1#PAPAX#Z) main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_GetErrorInfo#8 referenced in function "struct winrt::hresult __cdecl winrt::impl::get_runtime_activation_factory<struct winrt::Windows::Foundation::IActivationFactory>(struct winrt::param::hstring const &,void * *)" (??$get_runtime_activation_factory#UIActivationFactory#Foundation#Windows#winrt###impl#winrt##YA?AUhresult#1#ABUhstring#param#1#PAPAX#Z) main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysAllocString#4 referenced in function "public: virtual int __stdcall winrt::impl::error_info_fallback::GetDescription(wchar_t * *)" (?GetDescription#error_info_fallback#impl#winrt##UAGHPAPA_W#Z) main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysFreeString#4 referenced in function "public: static void __cdecl winrt::impl::bstr_traits::close(wchar_t *)" (?close#bstr_traits#impl#winrt##SAXPA_W#Z) main.obj : error LNK2019: unresolved external symbol _WINRT_IMPL_SysStringLen#4 referenced in function "public: __thiscall winrt::hresult_error::hresult_error(struct winrt::hresult,struct winrt::take_ownership_from_abi_t)" (??0hresult_error#winrt##QAE#Uhresult#1#Utake_ownership_from_abi_t#1##Z) C:\behe\My_life\programmation\rainmeter c++ app simple ii guess\main.exe : fatal error LNK1120: 5 unresolved externals
Unresolved External Symbols When Using NetCDF (Installed via vcpkg) with CMake in a C++ Project on Visual Studio
The question has been updated sinces its original posting. I have kept everything for context and information for people in the future, but the latest information and issues are at the bottom. I have found somewhat similar questions posted previously about related subjects, but none of them seemed to have a clear, concise resolution for what exactly I'm doing. I'm hoping that by asking this question, I can get an answer and there will also be a more clear answer available on the internet for future people with similar troubles. I am trying to create a simple example C++ code using NetCDF in Visual Studio 2019 with CMake as the build system. I installed NetCDF using vcpkg, specifically the command vcpkg install netcdf-cxx:x64-windows which installed all prerequisite packages and netcdf-cxx:x64-windows to C:\Program Files\vcpkg\packages. In the project itself, I have two main files: main.cpp and CMakeLists.txt. The directory structure is as follows: - C:\ - Users\ - Owner\ - Education and Research\ - Personal Projects\ - learning_coding\ - C++\ - cmake_netcdf\ - CMakeLists.txt - main.cpp The file main.cpp is #include <iostream> #include <netcdf> int main() { std::cout << "Hello world!" << std::endl; return 0; } while CMakeLists.txt is cmake_minimum_required (VERSION 3.17) project(cmake_netcdf) # Add source to this project's executable. add_executable(cmake_netcdf main.cpp) # Find and include the netcdf package find_package(netcdf CONFIG REQUIRED) target_link_libraries(cmake_netcdf PRIVATE netcdf ) Visual Studio can successfully refresh C++ IntelliSense information, 1> CMake generation started for configuration: 'x64-Debug'. 1> Found and using vcpkg toolchain file (C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake). 1> The toolchain file has changed (CMAKE_TOOLCHAIN_FILE). 1> Command line: "cmd.exe" /c ""C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\out\install\x64-Debug" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Program Files/vcpkg/scripts/buildsystems/vcpkg.cmake" "C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf" 2>&1" 1> Working directory: C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug 1> [CMake] -- The C compiler identification is MSVC 19.27.29111.0 1> [CMake] -- The CXX compiler identification is MSVC 19.27.29111.0 1> [CMake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe 1> [CMake] -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works 1> [CMake] -- Detecting C compiler ABI info 1> [CMake] -- Detecting C compiler ABI info - done 1> [CMake] -- Detecting C compile features 1> [CMake] -- Detecting C compile features - done 1> [CMake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe 1> [CMake] -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works 1> [CMake] -- Detecting CXX compiler ABI info 1> [CMake] -- Detecting CXX compiler ABI info - done 1> [CMake] -- Detecting CXX compile features 1> [CMake] -- Detecting CXX compile features - done 1> [CMake] -- Found ZLIB: optimized;C:/Program Files/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Program Files/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found version "1.2.11") 1> [CMake] -- Found ZLIB: optimized;C:/Program Files/vcpkg/installed/x64-windows/lib/zlib.lib;debug;C:/Program Files/vcpkg/installed/x64-windows/debug/lib/zlibd.lib (found suitable version "1.2.11", minimum required is "1") 1> [CMake] -- Configuring done 1> [CMake] -- Generating done 1> [CMake] -- Build files have been written to: C:/Users/Owner/Education and Research/Personal Projects/learning_coding/C++/cmake_netcdf/build/x64-Debug 1> Extracted CMake variables. 1> Extracted source files and headers. 1> Extracted code model. 1> Extracted includes paths. 1> CMake generation finished. but the project fails to build and gives the error messages cannot open source file "netcdf" and Cannot open include file: 'netcdf': No such file or directory. How can I fix this error? EDIT 1: Following up on the comments: "Can you check in the Solution Properties->Include Directories whether the path to the netcdf include is set?" – user3389943 This code isn't saved as a solution, but you did prompt me to look at the CMake variables. The directory variable for netcdf is netcdf_DIR = C:/Program Files/vcpkg/installed/x64-windows/share/netcdf-c, which looks like - C:/Program Files/vcpkg/installed/x64-windows/share/netcdf-c/ - copyright - netCDFConfig.cmake - netCDFConfigVersion.cmake - netCDFTargets.cmake - netCDFTargets-debug.cmake - netCDFTargets-release.cmake - usage - vcpkg_abi_info.txt There is not variable for netcdf_INCLUDES or anything of that sort. Is it an issue that it's looking at netcdf-c for a C++ program? How do I get CMake to look for the proper include directories? "There is no header named netcdf in the NetCDF package. It should read #include "netcdf.h"." – vre Making that change does not fix the error, it gives the same error replacing 'netcdf' with "netcdf.h". I think the proper include is netcdf, unless the tutorials are out-of-date. EDIT 2: Following up on the comments: ""I think the proper include is netcdf": The include file is definitely named netcdf.h. Your find_package call should try to find netCDF, case matters here. In the netCDFTargets-debug.cmake there is a target defined with add_library(<> IMPORTED ...). Use this target name for your target_link_libraries command." – vre Thank you for telling me about this file! The file netCDFTargets-debug.cmake reads #---------------------------------------------------------------- # Generated CMake target import file for configuration "DEBUG". #---------------------------------------------------------------- # Commands may need to know the format version. set(CMAKE_IMPORT_FILE_VERSION 1) # Import target "netCDF::netcdf" for configuration "DEBUG" set_property(TARGET netCDF::netcdf APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) set_target_properties(netCDF::netcdf PROPERTIES IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/debug/lib/netcdf.lib" IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/bin/netcdf.dll" ) list(APPEND _IMPORT_CHECK_TARGETS netCDF::netcdf ) list(APPEND _IMPORT_CHECK_FILES_FOR_netCDF::netcdf "${_IMPORT_PREFIX}/debug/lib/netcdf.lib" "${_IMPORT_PREFIX}/debug/bin/netcdf.dll" ) # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) So I changed my CMakeLists.txt to # Unit test for building a program with netCDF using CMake in visual studio. cmake_minimum_required (VERSION 3.17) project(cmake_netcdf) # Add source to this project's executable. add_executable(cmake_netcdf main.cpp) # Find and include the netcdf package find_package(netCDF CONFIG REQUIRED) target_link_libraries(cmake_netcdf PRIVATE netCDF::netcdf ) and now main.cpp builds! It builds using both #include <netcdf> and #include "netcdf.h". From here, I decided to change main.cpp to an example file on NCAR's website, so main.cpp now is /* This is part of the netCDF package. Copyright 2006 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for conditions of use. This is a very simple example which writes a 2D array of sample data. To handle this in netCDF we create two shared dimensions, "x" and "y", and a netCDF variable, called "data". This example is part of the netCDF tutorial: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-tutorial Full documentation of the netCDF C++ API can be found at: http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-cxx $Id: simple_xy_wr.cpp,v 1.5 2010/02/11 22:36:43 russ Exp $ */ #include <iostream> #include <netcdf> #include <vector> using namespace std; using namespace netCDF; using namespace netCDF::exceptions; // We are writing 2D data, a 6 x 12 grid. static const int NX = 6; static const int NY = 12; // Return this in event of a problem. static const int NC_ERR = 2; int main() { // This is the data array we will write. It will just be filled // with a progression of numbers for this example. int dataOut[NX][NY]; // Create some pretend data. If this wasn't an example program, we // would have some real data to write, for example, model output. for (int i = 0; i < NX; i++) for (int j = 0; j < NY; j++) dataOut[i][j] = i * NY + j; // The default behavior of the C++ API is to throw an exception i // an error occurs. A try catch block is necessary. try { // Create the file. The Replace parameter tells netCDF to overwrite // this file, if it already exists. NcFile dataFile("simple_xy.nc", NcFile::replace); // Create netCDF dimensions NcDim xDim = dataFile.addDim("x", NX); NcDim yDim = dataFile.addDim("y", NY); // Define the variable. The type of the variable in this case is // ncInt (32-bit integer). vector<NcDim> dims; dims.push_back(xDim); dims.push_back(yDim); NcVar data = dataFile.addVar("data", ncInt, dims); // Write the data to the file. Although netCDF supports // reading and writing subsets of data, in this case we write all // the data in one operation. data.putVar(dataOut); // The file will be automatically close when the NcFile object goes // out of scope. This frees up any internal netCDF resources // associated with the file, and flushes any buffers. //cout << "*** SUCCESS writing example file simple_xy.nc!" << endl; return 0; } catch (NcException& e) { e.what(); return NC_ERR; } } When trying to build this example file, I get a bunch of linker errors >------ Build All started: Project: cmake_netcdf, Configuration: x64-Debug ------ [1/2] Building CXX object CMakeFiles\cmake_netcdf.dir\main.cpp.obj [2/2] Linking CXX executable cmake_netcdf.exe FAILED: cmake_netcdf.exe cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmake_netcdf.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x64\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmake_netcdf.dir\main.cpp.obj /out:cmake_netcdf.exe /implib:cmake_netcdf.lib /pdb:cmake_netcdf.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console "C:\Program Files\vcpkg\installed\x64-windows\debug\lib\netcdf.lib" "C:\Program Files\vcpkg\installed\x64-windows\debug\lib\hdf5_hl_D.lib" "C:\Program Files\vcpkg\installed\x64-windows\debug\lib\hdf5_D.lib" "C:\Program Files\vcpkg\installed\x64-windows\debug\lib\libcurl-d.lib" "C:\Program Files\vcpkg\installed\x64-windows\debug\lib\zlibd.lib" wldap32.lib winmm.lib ws2_32.lib advapi32.lib crypt32.lib advapi32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D "C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug" && powershell -noprofile -executionpolicy Bypass -file "C:/Program Files/vcpkg/scripts/buildsystems/msbuild/applocal.ps1" -targetBinary "C:/Users/Owner/Education and Research/Personal Projects/learning_coding/C++/cmake_netcdf/build/x64-Debug/cmake_netcdf.exe" -installedDir "C:/Program Files/vcpkg/installed/x64-windows/debug/bin" -OutVariable out"" LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmake_netcdf.dir\main.cpp.obj /out:cmake_netcdf.exe /implib:cmake_netcdf.lib /pdb:cmake_netcdf.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console C:\Program Files\vcpkg\installed\x64-windows\debug\lib\netcdf.lib C:\Program Files\vcpkg\installed\x64-windows\debug\lib\hdf5_hl_D.lib C:\Program Files\vcpkg\installed\x64-windows\debug\lib\hdf5_D.lib C:\Program Files\vcpkg\installed\x64-windows\debug\lib\libcurl-d.lib C:\Program Files\vcpkg\installed\x64-windows\debug\lib\zlibd.lib wldap32.lib winmm.lib ws2_32.lib advapi32.lib crypt32.lib advapi32.lib crypt32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmake_netcdf.dir/intermediate.manifest CMakeFiles\cmake_netcdf.dir/manifest.res" failed (exit code 1120) with the following output: C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl netCDF::NcDim::NcDim(class netCDF::NcDim const &)" (??0NcDim#netCDF##QEAA#AEBV01##Z) referenced in function "public: static void __cdecl std::_Default_allocator_traits<class std::allocator<class netCDF::NcDim> >::construct<class netCDF::NcDim,class netCDF::NcDim &>(class std::allocator<class netCDF::NcDim> &,class netCDF::NcDim * const,class netCDF::NcDim &)" (??$construct#VNcDim#netCDF##AEAV12##?$_Default_allocator_traits#V?$allocator#VNcDim#netCDF###std###std##SAXAEAV?$allocator#VNcDim#netCDF###1#QEAVNcDim#netCDF##AEAV34##Z) C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: class netCDF::NcVar __cdecl netCDF::NcGroup::addVar(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class netCDF::NcType const &,class std::vector<class netCDF::NcDim,class std::allocator<class netCDF::NcDim> > const &)const " (?addVar#NcGroup#netCDF##QEBA?AVNcVar#2#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##AEBVNcType#2#AEBV?$vector#VNcDim#netCDF##V?$allocator#VNcDim#netCDF###std###5##Z) referenced in function main C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: class netCDF::NcDim __cdecl netCDF::NcGroup::addDim(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned __int64)const " (?addDim#NcGroup#netCDF##QEBA?AVNcDim#2#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##_K#Z) referenced in function main C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl netCDF::NcFile::NcFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum netCDF::NcFile::FileMode)" (??0NcFile#netCDF##QEAA#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##W4FileMode#01##Z) referenced in function main C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl netCDF::NcFile::~NcFile(void)" (??1NcFile#netCDF##UEAA#XZ) referenced in function main C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl netCDF::NcVar::putVar(void const *)const " (?putVar#NcVar#netCDF##QEBAXPEBX#Z) referenced in function main C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\main.cpp.obj : error LNK2001: unresolved external symbol "class netCDF::NcInt netCDF::ncInt" (?ncInt#netCDF##3VNcInt#1#A) C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\build\x64-Debug\cmake_netcdf.exe : fatal error LNK1120: 7 unresolved externals ninja: build stopped: subcommand failed. Build All failed. I tried replacing #include <netcdf> with #include "netcdf.h" but I got even more errors: [1/2] Building CXX object CMakeFiles\cmake_netcdf.dir\main.cpp.obj FAILED: CMakeFiles/cmake_netcdf.dir/main.cpp.obj C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1427~1.291\bin\Hostx64\x64\cl.exe /nologo /TP -DDEBUG -DH5_BUILT_AS_DYNAMIC_LIB -I"C:\Program Files\vcpkg\installed\x64-windows\include" /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0 /Od /RTC1 -MDd /showIncludes /FoCMakeFiles\cmake_netcdf.dir\main.cpp.obj /FdCMakeFiles\cmake_netcdf.dir\ /FS -c ..\..\main.cpp C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(22): error C2871: 'netCDF': a namespace with this name does not exist C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(23): error C2653: 'netCDF': is not a class or namespace name C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(23): error C2871: 'exceptions': a namespace with this name does not exist C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(53): error C2065: 'NcFile': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(53): error C2146: syntax error: missing ';' before identifier 'dataFile' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(53): error C2653: 'NcFile': is not a class or namespace name C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(53): error C2065: 'replace': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(53): error C3861: 'dataFile': identifier not found C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(56): error C2065: 'NcDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(56): error C2146: syntax error: missing ';' before identifier 'xDim' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(56): error C2065: 'xDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(56): error C2065: 'dataFile': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(57): error C2065: 'NcDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(57): error C2146: syntax error: missing ';' before identifier 'yDim' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(57): error C2065: 'yDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(57): error C2065: 'dataFile': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(61): error C2065: 'NcDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(61): error C2923: 'std::vector': 'NcDim' is not a valid template type argument for parameter '_Ty' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(61): error C2976: 'std::vector': too few template arguments C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\vector(413): note: see declaration of 'std::vector' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(61): error C2133: 'dims': unknown size C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(61): error C2512: 'std::vector': no appropriate default constructor available C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\vector(413): note: see declaration of 'std::vector' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(62): error C2065: 'xDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(63): error C2065: 'yDim': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(64): error C2065: 'NcVar': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(64): error C2146: syntax error: missing ';' before identifier 'data' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(64): error C2065: 'dataFile': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(64): error C2065: 'ncInt': undeclared identifier C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(78): error C2061: syntax error: identifier 'NcException' C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(78): error C2310: catch handlers must specify one type C:\Users\Owner\Education and Research\Personal Projects\learning_coding\C++\cmake_netcdf\main.cpp(80): error C2065: 'e': undeclared identifier ninja: build stopped: subcommand failed. Build All failed. Any insight on these new issues? A Google search brought me to this page which suggests that CMake is linking against a 32-bit version of the library (whereas my system is 64 bit), but I only have the 64-bit version of the library installed. Also, with regards to #include <netcdf> versus #include "netcdf.h", I have both files in C:\Program Files\vcpkg\installed\x64-windows\include (along with a bunch of header files related to HDF5 and stuff). It seems like <netcdf> is the whole thing while netcdf.h is just part of it? "netcdf_DIR is where find_package searches for the headers and libraries. Can you cross check the target name as #vre mentioned?" – user3389943 I certainly can! netcdf_DIR is C:/Program Files/vcpkg/installed/x64-windows/share/netcdf-c, which I mentioned the contents of in Edit 1. The netCDFTargets.cmake file has the line add_library(netCDF::netcdf SHARED IMPORTED), which I used for the newest version of the target_link_libraries command. EDIT 3: Following up on the comments: "So what other targets are defined in netCDFTargets.cmake" – user3389943 I'm not entirely sure how to parse netCDFTargets.cmake, so here are the contents: # Generated by CMake if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) message(FATAL_ERROR "CMake >= 2.6.0 required") endif() cmake_policy(PUSH) cmake_policy(VERSION 2.6) #---------------------------------------------------------------- # Generated CMake target import file. #---------------------------------------------------------------- # Commands may need to know the format version. set(CMAKE_IMPORT_FILE_VERSION 1) # Protect against multiple inclusion, which would fail when already imported targets are added once more. set(_targetsDefined) set(_targetsNotDefined) set(_expectedTargets) foreach(_expectedTarget netCDF::netcdf) list(APPEND _expectedTargets ${_expectedTarget}) if(NOT TARGET ${_expectedTarget}) list(APPEND _targetsNotDefined ${_expectedTarget}) endif() if(TARGET ${_expectedTarget}) list(APPEND _targetsDefined ${_expectedTarget}) endif() endforeach() if("${_targetsDefined}" STREQUAL "${_expectedTargets}") unset(_targetsDefined) unset(_targetsNotDefined) unset(_expectedTargets) set(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) return() endif() if(NOT "${_targetsDefined}" STREQUAL "") message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") endif() unset(_targetsDefined) unset(_targetsNotDefined) unset(_expectedTargets) # Compute the installation prefix relative to this file. get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) if(_IMPORT_PREFIX STREQUAL "/") set(_IMPORT_PREFIX "") endif() # Create imported target netCDF::netcdf add_library(netCDF::netcdf SHARED IMPORTED) set_target_properties(netCDF::netcdf PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "ZLIB::ZLIB;hdf5::hdf5-shared;hdf5::hdf5_hl-shared;CURL::libcurl" ) if(CMAKE_VERSION VERSION_LESS 2.8.12) message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") endif() # Load information for each installed configuration. get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) file(GLOB CONFIG_FILES "${_DIR}/netCDFTargets-*.cmake") foreach(f ${CONFIG_FILES}) include(${f}) endforeach() # Cleanup temporary variables. set(_IMPORT_PREFIX) # Loop over all imported files and verify that they actually exist foreach(target ${_IMPORT_CHECK_TARGETS} ) foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) if(NOT EXISTS "${file}" ) message(FATAL_ERROR "The imported target \"${target}\" references the file \"${file}\" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained \"${CMAKE_CURRENT_LIST_FILE}\" but not all the files it references. ") endif() endforeach() unset(_IMPORT_CHECK_FILES_FOR_${target}) endforeach() unset(_IMPORT_CHECK_TARGETS) # This file does not depend on other imported targets which have # been exported from the same project but in a separate export set. # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) Does that help?
Alright, I found a solution! It most certainly is not a perfect solution, but it is a solution. Unfortunately, I was not able to get it to work on Visual Studio with Windows. I will probably try again at some point, but I think the version of netCDF-cxx4 is out of date on vcpkg or something. I am currently away from my primary work station, so I will have to try again on there to see if I can get a solution in Visual Studio. Anyway, here's what I did that seemed to work: I downloaded Ubuntu 20.04.1 via the Windows Subsystem for Linux (WSL). I'm not sure if this will work for older or newer versions of Ubuntu, but I assume that it will. I also am using the Windows Terminal that they mention on that page and set up my colors with the vimrc example file found here. This changes how your file system works a bit by adding two layers above C:\, which are /mnt/. You can navigate to your files on Windows by going to /mnt/c/Users/ and to the Ubuntu subsystem by going to /. I named my Ubuntu account usr, so the 'desktop' Ubuntu files are kept in /home/usr. For all of the subsequent steps, I am using the Ubuntu terminal window in the Windows Terminal application. There was also an issue with installing zlib via vcpkg after enabling WSL, but I don't know how to resolve it nor have I found a solution anywhere. I downloaded a C++ compiler by running sudo apt install build-essential, and installed CMake and netCDF-C via sudo apt install cmake libnetcdf-dev. I installed netCDF-cxx4 by cloning their GitHub repository to my home directory /home/usr and using the commands mkdir build cd build cmake .. make ctest sudo make install If you don't have that sudo there, you'll get a permissions error. I found the netCDFCxxConfig.cmake file in the directory /usr/local/lib/cmake/netcdf and made some changes to the CMakeLists.txt file cmake_minimum_required(VERSION 3.8) # Set project name and version project(cmake_netcdfcxx4) # Find the netcdf-cxx4 library list(APPEND CMAKE_PREFIX_PATH "/usr/local/lib/cmake/netCDF") find_package(netCDFCxx REQUIRED) # Add source to this project's executable. add_executable(cmake_netcdfcxx4 main.cpp) # Link the netcdf-cxx4 library to the executable target_link_libraries(cmake_netcdfcxx4 PRIVATE netCDF::netcdf-cxx4 ) to add this directory to the CMAKE_PREFIX_PATH variable. I'm still looking into how to add the directory /usr/local/lib/cmake/ to the CMake search path automatically so the user doesn't have to edit the CMakeLists.txt file to compile this properly, so I guess this will require some updating. I hope this helps people in the future!
Different errors when trying to link cuRAND on Windows
I have a DLL that contains my CUDA code and recent added a pair .cuh/.cu with cuRAND code to be part of the DLL. Because there are a lot of linking problems regarding cuRAND, first I wrote a minimalist piece of code just to see if the thing links. For the sake of completion, the .cuh and .cu are, respectively: extern "C" { void simple_curand_test(void); } And #include "GPU_Rand.cuh" #include <curand.h> #include <curand_kernel.h> void simple_curand_test(void) { curandGenerator_t gen; curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT); } Then, my compiler command to generate the DLL is: nvcc -o bin\GPU_Methods.dll --shared src\GPU_Utils.cu src\GPU_Rand.cu -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64" -lcurand It ends with this error: Creating library bin/GPU_Methods.lib and object bin/GPU_Methods.exp tmpxft_000015a0_00000000-44_GPU_Rand.obj : error LNK2019: unresolved external symbol curandCreateGenerator referenced in function simple_curand_test bin/SCS_GPU.dll : fatal error LNK1120: 1 unresolved externals If I change the command to make the linker use the variable LIBRARIES, it looks like: set LIBRARIES="c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64" nvcc -o bin\GPU_Methods.dll --shared src\GPU_Utils.cu src\GPU_Rand.cu -lcurand Then the error turns to: nvlink fatal : Could not open input file 'c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\lib\x64' After spending some days reading and trying multiple combinations of parameters and commands, it is time to ask if you guys can spot what I am missing. UPDATE - 01/06/2018 These are the environment variables in a command prompt that runs nvcc (some of them were omitted because they are not relevant to the issue and to avoid bloating your screen even more): ALLUSERSPROFILE=C:\ProgramData CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1 CUDA_PATH_V9_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1 FP_NO_HOST_CHECK=NO HOMEDRIVE=C: NVCUDASAMPLES9_1_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1 NVCUDASAMPLES_ROOT=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.1 NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\ OS=Windows_NT Path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\libnvvp;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Programming\MSYS2\mingw64\bin;C:\Programming\Java\jdk1.8.0_162\bin;C:\Programming\Python365;C:\Programming\Python365\Lib;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\Hostx64\x64 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=5e03 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PROMPT=$P$G PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC=C:\Users\Public PYTHONPATH=C:\Programming\Python365;C:\Programming\Python365\Lib SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\Windows VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\ windir=C:\Windows
The way I managed to link cuRAND and generate the dll was using Visual Studio instead of the command line. Somehow it has the proper arguments for nvcc to link cuRAND that, I suspect, my environment variables are missing. Thanks to Robert Crovella for also giving it a try and providing input.
How to make CUDA 8 work on Visual Studio 2015 update 3 with CMake?
I am having trouble even to compile the simplest code for CUDA 8 and Visual Studio 2015 update 3. CUDASample.cuh class CUDASample { public: CUDASample(); ~CUDASample(); }; CUDASample.cu #include "CUDASample.cuh" CUDASample::CUDASample() { } CUDASample::~CUDASample(){ } I am getting compilation errors like 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(63): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(64): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(76): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(98): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(118): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(125): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(126): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(137): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(144): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(161): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(170): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(171): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(180): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(188): error : unknown attribute "guard" 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\corecrt_malloc.h(189): error : unknown attribute "guard" I am pretty sure it's a CUDA problem because if I change the source file extension to "cpp" and header extension to "h" everything works as usual. How can I solve this? EDIT: The commandline shown in properties -> Linker -> Command Line is /OUT:"C:\Users\David\Desktop\sample\build\bin\Release\cudasample.dll" /MANIFEST /NXCOMPAT /PDB:"C:/Users/David/Desktop/sample/build/bin/Release/cudasample.pdb" /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64\cudart_static.lib" /IMPLIB:"C:/Users/David/Desktop/sample/build/lib/Release/cudasample.lib" /DLL /MACHINE:X64 /INCREMENTAL:NO /PGD:"C:\Users\David\Desktop\sample\build\bin\Release\cudasample.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"cudasample.dir\Release\cudasample.dll.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 EDIT: As Robert mentioned, since I am able to compile the cuda samples successfully, the problem might be related to cmake configuration. Below is the CMakeLists I used which work for me when compiling on Visual Studio 2013 + CUDA 7.5. project(cudasample) set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/src/CUDASample.cu ) set(PROJECT_INCS ${PROJECT_SOURCE_DIR}/include/CUDASample.cuh ) include_directories(${PROJECT_SOURCE_DIR}/include) find_package( CUDA REQUIRED ) list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_52,code=sm_52;") list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_50,code=sm_50;") list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_35,code=sm_35;") list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30;") if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CUDA_PROPAGATE_HOST_FLAGS OFF) list(APPEND CUDA_NVCC_FLAGS "-std=c++11;") endif() cuda_add_library(${PROJECT_NAME} SHARED ${PROJECT_SRCS} ${PROJECT_INCS}) What could be wrong?
I at least managed to get it to work. The root cause is the sdl compiler flag in my head CMakeLists.txt set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /sdl") So if I add in this line in the project CMakeLists.txt string(REGEX REPLACE "/sdl" "/sdl-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") it will compile sucessfully. However it is still unclear to me why the sdl compiler flag will cause NVCC to fail in the combination of CUDA 8 and Visual Studio 2015 Update 3. Hopefully someone can come up with a better answer.
error MSB3721 when building CUDA Samples for VS2010, WINDOWS7, 64BIT
I have installed CUDA 5.5 Production Release with the default installation directory structure. Then I follow the NVIDIA CUDA Getting Started Guide for Microsoft Windows. The nvcc -V test and deviceQuery.exe and bandwidthTest.exe works fine in windows command promote. Then I try to build bandwidthTest project(located in the NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest) Some errors pop up as follows: 1>------ Build started: Project: bandwidthTest, Configuration: Release x64 ------ 1>Build started 2013/11/19 13:13:41. 1>AddCudaCompileDeps: 1>Skipping target "AddCudaCompileDeps" because all output files are up-to-date with respect to the input files. 1>AddCudaCompilePropsDeps: 1>Skipping target "AddCudaCompilePropsDeps" because all output files are up-to-date with respect to the input files. 1>CudaBuild: 1> Compiling CUDA source file bandwidthTest.cu... 1> 'C:\Users\IMI_User\AppData\Local\Temp' is not recognized as an internal or external command, 1> operable program or batch file. 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(592,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env --cl-version 2010 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu"" exited with code 1. 1> 1>Build FAILED. 1> 1) I fould one solution on the internet :https://devtalk.nvidia.com/default/topic/533797/visual-studio-2010-how-to-fix-error-msb3721-exiting-with-code-1/ which is quite similar to my situation. It mentions that it is the antivirus software that causes this problem. So I uninstalled any antivirus software and reinstall the CUDA 5.5 product. Restart the computer. But it didn't solve my problem. 2) I found another solution that should 'Run as a administrator'. Again, it won't help. CUDA 4.2. toolbox & VS2010 I build another sample project deviceQuery located in the NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\deviceQuery and sucessfully. Can anyone help me with the problem I have here? bandwidthTest_vs2010.log Build started 2013/11/20 12:24:19. Environment at start of build: MSBuildExtensionsPath32 = C:\Program Files (x86)\MSBuild MSBuildExtensionsPath64 = C:\Program Files\MSBuild MSBuildExtensionsPath = C:\Program Files (x86)\MSBuild LOCALAPPDATA = C:\Users\IMI_User\AppData\Local ALLUSERSPROFILE = C:\ProgramData APPDATA = C:\Users\IMI_User\AppData\Roaming BURN_AUTOPLAY = C:\Program Files (x86)\Roxio\OEM\Roxio Burn\ CommonProgramFiles = C:\Program Files (x86)\Common Files CommonProgramW6432 = C:\Program Files\Common Files COMPUTERNAME = IMI_USER-PC ComSpec = C:\Windows\system32\cmd.exe CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5 CUDA_PATH_V5_5 = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5 EMC_AUTOPLAY = C:\Program Files (x86)\Common Files\Roxio Shared\OEM\ FP_NO_HOST_CHECK = NO GNUPLOT_LIB = C:\tmp\gnuplot\demo HOMEDRIVE = C: HOMEPATH = \Users\IMI_User LOGONSERVER = \\IMI_USER-PC MOZ_PLUGIN_PATH = C:\Program Files (x86)\Foxit Software\Foxit Reader\plugins\ NUMBER_OF_PROCESSORS = 4 NVCUDASAMPLES5_5_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5 NVCUDASAMPLES_ROOT = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5 NVTOOLSEXT_PATH = C:\Program Files\NVIDIA Corporation\NvToolsExt\ OS = Windows_NT Path = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\libnvvp;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Services\IPT\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Dell\Dell Data Protection\Access\Advanced\Wave\Gemalto\Access Client\v5\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\OEM\12.0\DLLShared\;C:\Program Files (x86)\Roxio\OEM\AudioCore\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\; C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MATLAB\R2011b\bin\win32;C:\Program Files (x86)\Common Files\Autodesk Shared\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\opencv\build\x86\vc10\bin;C:\Program Files (x86)\opencv\build\common\tbb\ia32\vc10;C:\Deploy\bin\Win32\Release;C:\Program Files\MATLAB\R2011b\bin;D:\Research\SQA\CODES\opensmile-2.0-rc1\msvcbuild;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User\Scripts;C:\Program Files (x86)\Git\cmd;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User\Scripts;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\User;C:\Users\IMI_User\AppData\Local\Enthought\Canopy\System\Scripts PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC PBRT_SEARCHPATH = C:\pbrt-v1\pbrt-1.05\bin PROCESSOR_ARCHITECTURE = x86 PROCESSOR_ARCHITEW6432 = AMD64 PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 42 Stepping 7, GenuineIntel PROCESSOR_LEVEL = 6 PROCESSOR_REVISION = 2a07 ProgramData = C:\ProgramData ProgramFiles = C:\Program Files (x86) ProgramW6432 = C:\Program Files PSModulePath = C:\Windows\system32\WindowsPowerShell\v1.0\Modules\ PUBLIC = C:\Users\Public RCAUTOPLAY = C:\Program Files (x86)\Roxio\OEM\Roxio Central 5\ SESSIONNAME = Console SystemDrive = C: SystemRoot = C:\Windows TEMP = C:\Users\IMI_User\AppData\Local\Temp TMP = C:\Users\IMI_User\AppData\Local\TEMP_~1 USERDOMAIN = IMI_User-PC USERNAME = IMI_User USERPROFILE = C:\Users\IMI_User VisualStudioDir = C:\Users\IMI_User\Documents\Visual Studio 2010 VS100COMNTOOLS = c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\ windir = C:\Windows windows_tracing_flags = 3 windows_tracing_logfile = C:\BVTBin\Tests\installpackage\csilogfile.log 12:24:19.379 1>Project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" on node 2 (rebuild target(s)). 12:24:19.379 1>Building with tools version "4.0". 12:24:19.379 1>Target "_CheckForInvalidConfigurationAndPlatform: (TargetId:2)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (entry point): Task "Error" skipped, due to false condition; ( '$(_InvalidConfigurationError)' == 'true' ) was evaluated as ( '' == 'true' ). Task "Warning" skipped, due to false condition; ( '$(_InvalidConfigurationWarning)' == 'true' ) was evaluated as ( '' == 'true' ). Using "Message" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "Message" (TaskId:2) Configuration=Release (TaskId:2) Done executing task "Message". (TaskId:2) Task "Message" (TaskId:3) Platform=x64 (TaskId:3) Done executing task "Message". (TaskId:3) Task "Error" skipped, due to false condition; ('$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')) was evaluated as ('../../bin/win64/Release/' != '' and !HasTrailingSlash('../../bin/win64/Release/')). Task "Error" skipped, due to false condition; ('$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')) was evaluated as ('obj\' != '' and !HasTrailingSlash('obj\')). Task "Error" skipped, due to false condition; ('$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')) was evaluated as ('x64/Release/' != '' and !HasTrailingSlash('x64/Release/')). 12:24:19.400 1>Done building target "_CheckForInvalidConfigurationAndPlatform" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:2) 12:24:19.400 1>Target "_DetermineManagedStateFromCL: (TargetId:3)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it): 12:24:19.400 1>Done building target "_DetermineManagedStateFromCL" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:3) 12:24:19.400 1>Target "_PrepareForRebuild: (TargetId:4)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.BuildSteps.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it): 12:24:19.401 1>Done building target "_PrepareForRebuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:4) 12:24:19.401 1>Target "BeforeRebuild: (TargetId:5)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Rebuild" depends on it): 12:24:19.401 1>Done building target "BeforeRebuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:5) 12:24:19.401 1>Target "_PrepareForClean: (TargetId:6)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.BuildSteps.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): Task "Delete" skipped, due to false condition; (Exists($(LastBuildState))) was evaluated as (Exists(x64/Release/bandwidthTest.lastbuildstate)). 12:24:19.401 1>Done building target "_PrepareForClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:6) 12:24:19.401 1>Target "BeforeClean: (TargetId:7)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): 12:24:19.401 1>Done building target "BeforeClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:7) Target "UnmanagedUnregistration" skipped, due to false condition; ((('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or ('$(_AssemblyTimestampBeforeCompile)' == '')) and Exists('#(_UnmanagedRegistrationCache)')) was evaluated as ((('' != '' or '' != 'true' or 'exe' != 'library') or ('' == '')) and Exists('obj\bandwidthTest_vs2010.vcxproj.UnmanagedRegistration.cache')). 12:24:19.401 1>Target "CoreClean: (TargetId:8)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): Using "Delete" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "Delete" (TaskId:4) Done executing task "Delete". (TaskId:4) Using "ReadLinesFromFile" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "ReadLinesFromFile" (TaskId:5) Done executing task "ReadLinesFromFile". (TaskId:5) Using "FindUnderPath" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "FindUnderPath" (TaskId:6) Comparison path is "../../bin/win64/Release/". (TaskId:6) Done executing task "FindUnderPath". (TaskId:6) Task "FindUnderPath" (TaskId:7) Comparison path is "x64/Release/". (TaskId:7) Done executing task "FindUnderPath". (TaskId:7) Task "Delete" (TaskId:8) Done executing task "Delete". (TaskId:8) Using "RemoveDuplicates" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "RemoveDuplicates" (TaskId:9) Done executing task "RemoveDuplicates". (TaskId:9) Using "MakeDir" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "MakeDir" (TaskId:10) Done executing task "MakeDir". (TaskId:10) Using "WriteLinesToFile" task from assembly "Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "WriteLinesToFile" (TaskId:11) Done executing task "WriteLinesToFile". (TaskId:11) 12:24:19.404 1>Done building target "CoreClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:8) Target "AssignProjectConfiguration" skipped, due to false condition; ('#(ProjectReference)'!='') was evaluated as (''!=''). 12:24:19.404 1>Target "_SplitProjectReferencesByFileExistence: (TargetId:9)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CleanReferencedProjects" depends on it): Task "ResolveNonMSBuildProjectOutput" skipped, due to false condition; ('$(BuildingInsideVisualStudio)'=='true' and '#(ProjectReferenceWithConfiguration)'!='') was evaluated as ('true'=='true' and ''!=''). 12:24:19.404 1>Done building target "_SplitProjectReferencesByFileExistence" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:9) 12:24:19.404 1>Target "CleanReferencedProjects: (TargetId:10)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): Task "MSBuild" skipped, due to false condition; ('$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '#(_MSBuildProjectReferenceExistent)' != '') was evaluated as ('true' != 'true' and 'true' == 'true' and '' != ''). 12:24:19.404 1>Done building target "CleanReferencedProjects" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:10) 12:24:19.404 1>Target "CleanPublishFolder: (TargetId:11)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): Task "RemoveDir" skipped, due to false condition; ('$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')) was evaluated as ('C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\'=='C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\' and Exists('C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\x64\Release\app.publish\')). 12:24:19.404 1>Done building target "CleanPublishFolder" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:11) 12:24:19.404 1>Target "AfterClean: (TargetId:12)" in file "c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "Clean" depends on it): 12:24:19.404 1>Done building target "AfterClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:12) Target "EntityClean" skipped, due to false condition; ('#(EntityDeploy)' != '') was evaluated as ('' != ''). 12:24:19.404 1>Target "BeforeCppClean: (TargetId:13)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it): 12:24:19.404 1>Done building target "BeforeCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:13) 12:24:19.404 1>Target "CoreCppClean: (TargetId:14)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it): Task "MakeDir" (TaskId:12) Done executing task "MakeDir". (TaskId:12) Using "CppClean" task from assembly "Microsoft.Build.CppTasks.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". Task "CppClean" (TaskId:13) Done executing task "CppClean". (TaskId:13) Task "WriteLinesToFile" (TaskId:14) Done executing task "WriteLinesToFile". (TaskId:14) 12:24:19.409 1>Done building target "CoreCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:14) 12:24:19.409 1>Target "AfterCppClean: (TargetId:15)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it): 12:24:19.409 1>Done building target "AfterCppClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:15) 12:24:19.409 1>Target "PGInstrumentedClean: (TargetId:16)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppClean.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it): Task "Delete" (TaskId:15) Done executing task "Delete". (TaskId:15) 12:24:19.409 1>Done building target "PGInstrumentedClean" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:16) 12:24:19.409 1>Target "InitializeCudaHostProperties: (TargetId:17)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "AddCudaCompileMetadata" depends on it): 12:24:19.409 1>Done building target "InitializeCudaHostProperties" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:17) 12:24:19.410 1>Target "AddCudaCompileMetadata: (TargetId:18)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CudaClean" depends on it): Building target "AddCudaCompileMetadata" completely. No input files were specified. Using "SanitizePaths" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\Nvda.Build.CudaTasks.v5.5.dll". Task "SanitizePaths" (TaskId:16) Done executing task "SanitizePaths". (TaskId:16) Task "ReadLinesFromFile" (TaskId:17) Done executing task "ReadLinesFromFile". (TaskId:17) Using "SplitToItemMetadata" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\Nvda.Build.CudaTasks.v5.5.dll". Task "SplitToItemMetadata" (TaskId:18) Done executing task "SplitToItemMetadata". (TaskId:18) 12:24:19.422 1>Done building target "AddCudaCompileMetadata" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:18) 12:24:19.422 1>Target "ValidateCudaBuild: (TargetId:19)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CudaClean" depends on it): Task "Error" skipped, due to false condition; (!Exists($(CudaToolkitDir))) was evaluated as (!Exists(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\)). 12:24:19.422 1>Done building target "ValidateCudaBuild" in project "bandwidthTest_vs2010.vcxproj".: (TargetId:19) 12:24:19.422 1>Target "CudaClean: (TargetId:20)" in file "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets" from project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (target "CppClean" depends on it): Building target "CudaClean" completely. No input files were specified. Initializing task factory "XamlTaskFactory" from assembly "Microsoft.Build.Tasks.v4.0". Using "CudaCompile" task from the task factory "XamlTaskFactory". Task "CudaCompile" (TaskId:19) cmd.exe /C "C:\Users\IMI_User\AppData\Local\Temp;\8f2923f4a8704bedb3b1e52239ac5f64.cmd" (TaskId:19) "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu" -clean (TaskId:19) 'C:\Users\IMI_User\AppData\Local\Temp' is not recognized as an internal or external command, (TaskId:19) operable program or batch file. (TaskId:19) 12:24:19.668 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.5.targets(758,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\bin\nvcc.exe" -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64" -I./ -I../../common/inc -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -Xcompiler "/wd 4819" -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -o x64/Release/bandwidthTest.cu.obj "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest.cu" -clean" exited with code 1. Done executing task "CudaCompile" -- FAILED. (TaskId:19) 12:24:19.669 1>Done building target "CudaClean" in project "bandwidthTest_vs2010.vcxproj" -- FAILED.: (TargetId:20) 12:24:19.669 1>Done Building Project "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj" (rebuild target(s)) -- FAILED. Project Performance Summary: 290 ms C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.5\1_Utilities\bandwidthTest\bandwidthTest_vs2010.vcxproj 1 calls 290 ms rebuild 1 calls Target Performance Summary: 0 ms CleanReferencedProjects 1 calls 0 ms CleanPublishFolder 1 calls 0 ms AfterCppClean 1 calls 0 ms PGInstrumentedClean 1 calls 0 ms ValidateCudaBuild 1 calls 0 ms BeforeCppClean 1 calls 0 ms BeforeClean 1 calls 0 ms _DetermineManagedStateFromCL 1 calls 0 ms _SplitProjectReferencesByFileExistence 1 calls 0 ms AfterClean 1 calls 0 ms InitializeCudaHostProperties 1 calls 0 ms BeforeRebuild 1 calls 0 ms _PrepareForClean 1 calls 1 ms _PrepareForRebuild 1 calls 3 ms CoreClean 1 calls 5 ms CoreCppClean 1 calls 12 ms AddCudaCompileMetadata 1 calls 21 ms _CheckForInvalidConfigurationAndPlatform 1 calls 247 ms CudaClean 1 calls Task Performance Summary: 0 ms RemoveDuplicates 1 calls 0 ms FindUnderPath 2 calls 0 ms MakeDir 2 calls 1 ms WriteLinesToFile 2 calls 2 ms Delete 3 calls 2 ms SplitToItemMetadata 1 calls 2 ms CppClean 1 calls 3 ms ReadLinesFromFile 2 calls 3 ms SanitizePaths 1 calls 15 ms Message 2 calls 45 ms CudaCompile 1 calls Build FAILED. Time Elapsed 00:00:00.28
It looks like you have a ";" on the end of the path stored in your TEMP environment variable. This should be removed as the TEMP variable is only a single path, not a list of paths. After modifying the TEMP variable in the OS, restart Visual Studio. In Windows 7, type advanced system settings in the Start button search field. In the Advanced tab, click Environment Variables. Click TEMP in User variables, then click Edit and remove the ";" from the end of the path. Edit: I just noticed that in the environment variable list at the beginning of the log, there is no ";" at the end of the TEMP path, so this might not be the solution. The best clue we have to what's going on is this line: cmd.exe /C "C:\Users\IMI_User\AppData\Local\Temp;\8f2923f4a8704bedb3b1e52239ac5f64.cmd" (TaskId:19) The ";" after Temp is what is breaking the build.