Changing target to x64 breaks the FLTK build in Visual Studio 2017 - visual-studio-2017

I'm trying to build the FLTK version 1.3.4 which you can find from http://www.fltk.org/software.php in Visual Studio 2017.
I unzip everything, navigate to the ide/VisualC2010/ folder, and open the fltk.sln file in Visual Studio 2017.
Visual Studio asks if I would like to upgrade project targets to the latest Microsoft Visual Studio 2017 toolset. The upgrade options are Windows SDK Version: 10.0.16299.0 and Platform Toolset: Upgrade to v141. I press OK.
At this point if I do Build->Build Solution (Ctrl Shift B), everything works. However I noticed that the target is Win32 and I would like to also compile the library so I can link against x64 programs.
I go to Build->Configuration Manager and then in the Active Solution Platform->New... and Type or select new platform: x64 and Copy settings from: Win32 and Create new project platforms [checked] and then I press OK. This takes a while to complete.
Repeating step 3 no longer succeeds, with many projects failing with fatal error c1041: cannot open program database ...
I am pretty much a beginner at Visual Studio and I don't really understand what I'm doing. Can someone clue me in on what is happening here?

Fixed it by going to Tools -> Options and then Build and Run and then I changed maximum number of parallel project builds from 4 to 1.

Related

CUDA: Triple Angle Brackets gives me an error in Visual Studio [duplicate]

I'm trying to install CUDA, but I get a message saying "No supported version of visual studio was found". I think that this is because I am using Visual Studio 2017 (Community), and CUDA currently only supports up to Visual Studio 2015. Unfortunately, Microsoft will not allow me to download old versions of Visual Studio without paying a subscription fee.
Is there a way I can get around the compatibility issue with VS 2017, or can I not use CUDA?
If you want to install CUDA 8.0 with Visual Studio 2017 you need to install additional components for Visual Studio 2017.Click on the Start Menu and type Visual Studio Installer. Open Visual Studio InstallerOpen Individual components tab and select VC++ 2015.3 v140 toolset
under Compilers, build tools and runtimes.
You also need to install .NET Framework 3.5 if you didn't have it installed. Nvda.Build.CudaTasks.v8.0.dll assembly dependents on MS .NET Framework 3.5.
Open Classical Control Panel, go to Programs and features and press Turn Windows features on or off. Check .NET Framework 3.5 and press OK.
Download full CUDA toolkit distribution and extract it somewhere on your disk.
If you didn't have CUDA toolkit installed, do it now. If you have only Visual Studio 2017 installed, unselect Visual Studio integration checkbox.
Now you want to receive the "No supported version of the visual studio was found" error.
But in order to successfully build Cuda toolkit projects in Visual Studio 2017, you also need to follow steps 5 and 6.
Go to the CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions folder in your extracted distribution, copy all the files and paste them to C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\BuildCustomizations:
In the last step, you will need to edit your Cuda projects to recognize NVidia's build tasks from Visual Studio 2017. Open your .vcxproj file in a text editor and find all occurrences of CUDA 8.0.props. Replace the macro at the beginning of the string with $(VCTargetsPath14) so that XML snippet would look as follows:
<ImportGroup Label="ExtensionSettings">
<Import Project="$(VCTargetsPath14)\BuildCustomizations\CUDA 8.0.props" /></ImportGroup>
Don't forget to edit the custom targets path at the end of the file:
<ImportGroup Label="ExtensionTargets">
<Import Project="$(VCTargetsPath14)\BuildCustomizations\CUDA 8.0.targets" /></ImportGroup>
Make sure to double check your path conifuration!
If you use nvcc from command prompt you might not be calling cl.exe from Visual Studio folder!
Now you can build your Cuda project from Visual Studio 2017.
Parts of this solution are from Oleg Tarasov blog.
At the moment, Microsoft still seems to be making VS2015 Update 2 community edition available. You have to join the "dev essentials" program, but it seems to be free.
I was able to download the installer from here recently.
Update: CUDA 9 RC was made available yesterday at developer.nvidia.com to registered developers, and it has support for VS 2017.
Thank you everyone for your help. I just wanted to supplement this post with the last pieces of the puzzle. CUDA v9.0 RC is looking for VS2017 to identify as 1910 but the latest update actually identifies as 1911. To fix open .../CUDA/v9.0/include/crt/host_config.h and change this line:
#if _MSC_VER < 1600 || _MSC_VER > 1910
to this:
#if _MSC_VER < 1600 || _MSC_VER > 1911
You may also have to add the following to your CMakeLists:
list(APPEND CUDA_NVCC_FLAGS --cl-version=2017)
For people seeing this latter.
First, try to just install CUDA 10 (CUDA Toolkit 10.0).
If it still doesn't work without any mods make sure that you have as many VC++ toolsets as you see on the list. Check out this video, stop at 8:41 and compare the lists.
If for some reason you have to use CUDA 9.0 - 9.2 you will need to jump some hoops:
For cmd builds set vcvars_ver=14.11 - see this answer
For IDE builds set Platform Toolset (in project properties - General) to
Visual Studio 2017 (v141)) or
Visual Studio 2015 (v140))
If you have very customized cmd based build, hunt #if _MSC_VER (in .../CUDA/.../include/crt/host_config.h) and remove trailing || _MSC_VER > ...
In order to get working Cuda compiler nvcc in windows shell you need to do following
install proper toolset version from individual component for VS 2017 - VC++ 2017 version 15.4 v.14.11 toolset
Run in windows shell following "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11
You can compile nvcc code without errors from windows shell
I ran into the same issue using CUDA 9.1 and VS2017 Enterprise.
After changing the VC++ compiler to v140 (instead of 141) everything runs fine.
Already had flags
#if _MSC_VER < 1600 || _MSC_VER > 1911
But it wouldn't stop showing the error.
No idea why, but trying to run it on VS2015 lead to errors about v141 not being installed... so because of some twisted logic I tried to not use v141 where it was installed... and everything worked!!
Leaving this here as it may help someone else in the same situation. (although I really don't understand the why, how, when, who or what of the solution.
Latest update (correct as of 06/12/2018) latest Cuda version is 9.2 and latest Visual Studio version is 2017.7 do NOT work together. The instructions provided in solution above don't work. Here is what worked for me:
Uninstall Visual Studio.
Uninstall Visual Studio Installer
Download Visual Studio 2017.6 (note that Microsoft is known to change links and revisions without notice) https://learn.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017
Launch installer
Go to Individual Components. Click on Windows 10 SDK 10.0.15063
enter image description here
Download cuda Toolkit from the official website: https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal
You may need to download patch.
I wanted to edit my CUDA programs using a text editor (i.e. Sublime) and compile them from the command prompt but I ran into an nvcc compiler error. I installed Visual Studio 2017 with Windows 10 OS but after compiling, it said "only version of VS 2012, 13, 15 and 17 are allowed." So what I did was to intall VC++ 2015 toolkit from the installation package of the VS 2017 installer (refer to the image of the top post). I didnt go through his entire process instead, I only copied the path of my cl.exe file from the newly created VS 14.0 folder to the environment variable. The .exe can be found here:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
Hope this helps!
Just as update. My compatibility is:
Cuda version 11.2
Visual Studio Community 2019

Using UE4 with Visual Studio 2017

I recently did some cleaning of my drives. I decided to install visual studio 2017 after cleaning the drives up. I have been trying to continue work on my old UE4 project using the engine pulled from GitHub. I tried rebuilding the project with VS2017 which I know is not fully supported yet. I did run into quite a few problems, including the missing corecrt.h files. I reinstalled the Windows SDK to fix this.
The current problem is a new missing file called windows.h, and I believe it is missing due to the build tools looking for the wrong version of the SDK. I was wondering, has anyone else successfully integrated Visual Studio 2017 with their UE4 project after running into similar problems?
-- Edited due to poor grammar.
As I know Version 4.15 supports both Visual Studio 2015 (default) and Visual Studio 2017. If you are building the Engine from source code, you would want to open a command prompt after running Setup.bat and run the command GenerateProjectFiles.bat -2017. This will give you a Visual Studio 2017 solution for the Engine.
To use Visual Studio 2017 for projects, you can set your preference for which version projects use by going to Edit -> Editor Preferences -> General -> Source Code and choosing Visual Studio 2017 in the Source Code Editor setting.
If regenerating the Engine's VS project files doesn't help. Try regenerating your own UE4 project's VS project files.
With Visual Studio and UE4 closed, find the .uproject file, right click and select Generate Visual Studio project files.
Open the solution, make sure your UE4 game (e.g. MyProject) under the Games folder is set as the StartUp project (right click, Set as StartUp project), then try a compile.

Opening VS 2012 C++ Project in VS 2015 gives Build error

We have a C++ Project built in VS 2012 (To generate .arx files to work with AutoCad 2014). Now we need to recompile it in VS 2015. we have not installed VS 2012. I opened the project in VS 2015. Properties -> General -> Platform toolset is set to Visual Studio 2015 (v140). Still we are getting "The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools."
we created a simple C++ Console application and ran it. Works fine no build error there.
Need to recompile the files for building .arx files to work in AutoCad 2018.
Initial Project Load :->
In the initial project load itself for Nimcad and planact we are getting build tools error. But not for engr.
Build on engr Project getting errors this might be the changes in ObjectARX 2018 I don't know. If you have a solution for this error please let us know:->
Buid on Nimcad Project :->
Build on Planact Project :->
For both Nimcad and planact all we get is build tools error.
Property Pages :
Any help please.
To build AutoCAD 2018 ObjectARX app you'll need Visual Studio 2015 Update 3 configured (by default) with VC14.0. As you are migrating a project, make sure to adjust all libraries (.lib files) to version 22. Did you download the ObjectARX 2018 SDK?
Update
This seems a problem with your Visual Studio installation. If you create a new C++ project, VS should also ask you to install the missing parts.
In Visual Studio 2015 (...) the C++ compiler, libraries, and project templates have been moved into an optional feature. (...) To install the various components needed for desktop and mobile development in C++, you must choose “Custom” and manually select those items (Visual C++ Team Blog)
You may need to re-run VS setup and select the C++ related parts (as already mentioned on the question comments).
Finally, check your VisualStudioVersion using the VS2015 Command Prompt:

MSBuild configuration error WDK 8.1 Visual Studio 2015 to build kernel mode driver

I'm struggling with VS 2015 C++ 'Platform Toolset' configuration property to build a test *.sys kernel driver I want play around this night.
So, this is a fresh new installation of VS 2015 Pro (update 1) plus WDK 8.1 (just downloaded) running on clean Win 8.1
All libs and headers like ntddk.h are in place.
But C++ Solution Explorer -> General -> Platform Toolset does not eat every option:
Visual Studio 2015 (v140) -- ok
Visual Studio 2015 - Windows XP (v140_xp) -- ok
WindowsApplicationForDrivers8.1 -- error
WindowsKernelModeDriver8.1 -- error (need this one)
WindowsUserModeDriver8.1 -- error
Nags as follows:
One or more values are invalid. MSBuild returned the following error:
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\v120\Microsoft.cpp.props" was not
found. (Directory exists though!) Confirm that the path in the
declaration is correct, and that the file exists on disk.
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Redirect.12.props
I don't know what it could be. Am I supposed to have WDK 10 towards to VS2015?!
Anyway, I need the ability to build the driver on VS 2015.
Could it be directed compiler scripts?
Any ideas?
Ok
Moving to WDK 10 helped!
https://msdn.microsoft.com/en-us/windows-drivers/develop/building_a_driver
Ensure that you have the same version of SDK and WDK installed on your
computer.
You need to install the driver update for visual studio if you are working on visual studio then you have to get the proper update for it. I've a link please follow this link and you will get rid off from this problem..enter link description here
enter link description here

Visual Studio 2013: CL.exe exited with code -1073741515

I have a fresh Windows 8.1 Pro x64 install with a fresh Visual Studio 2013 Pro.
When trying to compile a project with Platform Toolset to Windows7.1SDK I'm getting
Error 1 error MSB6006: "CL.exe" exited with code -1073741515. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.targets 57 5 MenuBrowser
I tried running the supplied "Windows SDK Configuration Tool" and besides getting an error about Visual Studio 2005 and 2008 not being installed I think it did its job.
I tried manually editing the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows
where I manually put CurrentInstallFolder as C:\Program Files\Microsoft SDKs\Windows\v7.1\ and CurrentVersion as 7.1.7600.0.30514. If I look at the project properties and click the different paths / variables in there -> more -> Macros, I can see that $(WindowsSdkDir) is correct.
Any idea as to what I should try? Never ran into this problem on the old development computer with Windows 7 and VS 2012.
L.E. as a note, if I try a new project with the v120 tools, it works, but I need the Windows7.1SDK tools.
When trying to compile a project with Platform Toolset to Windows7.1SDK...
That's not a valid selection in a "fresh" install for VS2013. Not very clear what you've been doing, it certainly isn't "fresh" anymore. Do treat Regedit.exe as a loaded weapon, the registry key set that configures VS has been getting pretty doggone convoluted as of late.
The compiler crashes with -1073741515 == 0xC0000135 == STATUS_DLL_NOT_FOUND. That's a pretty serious mishap of course, it should never occur when you target SDK 7.1 since that still uses the same compiler, only the SDK directory is changed. The compiler itself, as well as the DLLs it uses, are not part of the SDK and only are provided if the machine doesn't have VS installed. You can use SysInternals' Process Monitor to diagnose this, you'll see the CL.EXE process searching for a DLL and not finding it.
The correct way to target 7.1 is to use the v120_xp toolset selection. That builds programs that can still run on XP, it automatically also selects the 7.1A SDK that was installed on your machine. Do try to undo the changes you've made.
Referencing Yodans solution from
How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?:
As pointed out by Hans Passant cl.exe looks for mspdb100.dll (among others) and does not find them.
The needed files are in the directory mentioned in 7. below:
My working setup:
VS2013 needs to use VS2010 libs
Using WinSDK 7.1 build tools (v100) in VS2013
clean install, uninstalling everything mentioned in the sdk release notes (can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=8279 under category Details)
Microsoft Windows SDK for Windows 7 (7.1) (the Windows SDK core-component files)
Application Verifier
Debugging Tools for Windows
Windows Performance Toolkit
Microsoft Help Viewer 1.0
Microsoft Visual C++ 2010 Redistributable
Microsoft Visual C++ 2010 Standard Edition
Additionally removed all .NET and VC++ related MS Software (not tested if necessary)
choosing Windows7.1SDK as Platform Toolset in VS2013
error MSB6006: "CL.exe" exited with code -1073741515
cl.exe looks for one of msobj100.dll, mspdb100.dll, mspdbcore.dll and mspdbsrv.exe
Added to PATH: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Build works and binary is usable!
A mistake I did:
copied files in 6. above to C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin, believing this directory is in PATH, but it was not!
So better do as sugested in 7. above or by Yodan in How to build with v90 platform toolset in VS2012 without VS2008, using Windows SDK?
The following steps work for me in VS 2017.
1.Close VS 2017.
2.Restart machine.
3.Open solution in VS 2017.
4.Build the project.
This time I didn't get following error and it builds successfully.
error msb6006 "link.exe" exited with code -1073741819.