Normally, when I use Visual Studio to do a build, I see warnings and errors shown in the output pane, e.g.
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
Compiling...
foo.cpp
Linking...
foo.obj : error LNK2001: unresolved external symbol "foo"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm doing some GPU programming with CUDA. Upon upgrading to 2.1, I no longer get any useful output in Visual Studio. For example, all I now see is:
1>------ Build started: Project: pdcuda, Configuration: Release x64 ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The other details can be found in BuildLog.htm, but it's inconvenient to hunt that file down all the time.
Does anyone know how to force Visual Studio to show the output in its output pane?
Things that don't help:
uninstalling CUDA: the problem persists in all projects
Tools > Options > Projects and Solutions > Build and Run > MSBuild project build output verbosity: changing this pulldown, even to "Diagnostic" has no discernable effect.
EDIT: Additional things that don't help:
devenv.exe /resetsettings
devenv.exe /resetuserdata
UPDATE (in response to Die in Sente): It's now working on one of the two machines (I'm not sure what I did to fix it though). The machine that's still having problems has a CUDA Visual Studio Wizard installed that has caused similar problems before. The still-broken machine had version 15.00.21022.8 of the compiler. The working machine has 15.00.30729.1. After making a backup, I transferred "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64" from the working to the broken machine. I observe no changes in behavior on the broken machine.
I have exactly the same problem, but without CUDA. Today Visual Studio just decided it wasn't going to show any build messages anymore. It was working fine, then one of my builds it just stopped working. The problem persists over all my projects now, and persists over reboots. I also see the correct messages in buildlog.htm. This is ridonkulous!
EDIT: Ooh, I used the add/remove programs to do a repair, and now it works again! Yeah!
did you tried to reset IDE
devenv.exe /resetsettings
or
devenv.exe /resetuserdata
I also recently install CUDA 2.1 (on top of 2.0 I believe). The default installation for CUDA 2.1 moved the SDK from
C:\Program Files\NVIDIA Corporation\NVIDIA CUDA SDK\
to
C:\Documents and Settings\All Users\Application Data\NVIDIA Corportation\NVIDIA CUDA SDK\
which initially caused me some problems. Are all of your paths resolving correctly?
This might sound like a far out suggestion. Get the CUDA SDK and try your code with the sample CUDA-C++ project in there. Maybe something changed in the build rules for CUDA v2.1.
If you go to Tools->Options->Projects and Solutions->Build and Run. Last property is "MSBuild Project build output verbosity". It defaults to Minimal, change it to normal and the build messages will show up in Output window.
This also enables any <Message Text="test message"></Message> output to show up in Visual Studio Build Output Window.
Final solution: reinstall the OS.
Related
I'm using Visual Studio Community 2022. Now I have a similar problem with Visual studio 2013 "A task was cancelled".
A few moments ago, everything went alright. However I suddenly found that when I try to build my cpp project, VS only output
1>----— Build started: Project: MyConsoleApp, Configuration: Release x64 —----
After about 5 minutes, it becomes
1>----— Build started: Project: MyConsoleApp, Configuration: Release x64 —----
1>A task was canceled.
1>A task was canceled.
========= Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
All my cpp projects have the same problem now. My time zone is correct. I have tried to reopen VS, restart my computer and reinstall Visual Studio, but this problem still exists.
I have the same problem as you, since February 28th, VS2022 could not build any project, until today, I uninstalled the anti-virus software (360 Security Guard) installed on my computer, it returned to normal work, I think this is due to the anti-virus software update caused by the incompatible VS2022, You can try uninstalling the anti-virus software installed on your computer, which may solve the problem
this is my first time using visual studio after reinstall windows and stuff which happened around a year ago, and whenever i tryto compile, i get this error,
1>------ Build started: Project: TrainerBasic, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
1>CVTRES : fatal error CVT1101: cannot open 'C:\Users\gamz\AppData\Local\Temp\lnk{E3BAB312-249D-4367-A832-80B6F6B34AFB}.tmp' for reading
1>Done building project "BasicProgram.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
So, i don't have an antivirus software, my hardware is not full, i tried cleaning the solution.. i don't know what could be the problem... and i really want to get back to visual studio, as any other online compilers don't have windows.h for example. I ALSO TRIED TO USE THE REPAIR FUNCTION IN VISUAL STUDIO. P.S. I am using visual studio community 2019
Linker Tools Error LNK1123:
Input files must have the Common Object File Format (COFF) format. If
an input file is not COFF, the linker automatically tries to convert
32-bit OMF objects to COFF, or runs CVTRES.EXE to convert resource
files. This message indicates that the linker could not convert the
file. This can also occur when using an incompatible version of
CVTRES.EXE from another installation of Visual Studio, the Windows
Development Kit, or .NET Framework.
I suggest you could follow the following methods to fix the issue:
1,Try building with incremental linking disabled.Property->Linker. Change the value of Enable Incremental Linking to No.
2,Try turning off the Embed Manifest option.Property-> Manifest Tool->Input and Output. Change the value of Embed Manifest to No.
3,Verify that the version of CVTRES.EXE found first in your PATH environment variable matches the version of the build tools, or the version of the Platform Toolset, used by your project.
For more details I suggest you could refer to the Doc:https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1123?view=vs-2019
According to the Doc
The Visual Studio compilers and build tools can report many kinds of
errors and warnings. After an error or warning is found, the build
tools may make assumptions about code intent and attempt to continue,
so that more issues can be reported at the same time. If the tools
make the wrong assumption, later errors or warnings may not apply to
your project. When you correct issues in your project, always start
with the first error or warning that's reported, and rebuild often.
One fix may make many subsequent errors go away.
As far as I'm concerned, after you fix link1123 error, CVTRES errors and warnings may go away.
I have a project of roughly 50 files that I build with the CMake integration in Visual Studio 2017 (latest release, version 15.0.0+26228.9).
If I regenerate my CMake cache and then build, my project is built normally. However, if I change something in one of my files, then try to rebuild without regenerating my CMake cache, nothing happens.
This is what the build window looks like:
Build started ...
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
Nothing will be built until I regenerate my CMake cache, where I will only be able to build once before getting the same issue.
Same issue happens on any CMake project I try to build. This issue only started happening on the latest full release of Visual Studio 2017, this did not happen in the RC builds.
I ended up repairing the Visual Studio 2017 install from the Visual Studio installer and that fixed it. Everything works as intended now.
After installing VS 2013 (Update 3) on windows 7 SP1 I have similar situation like in this post After installing windows 8.1 sdk visual studio cant build any win32 project and print output :
1>----— Build started: Project: ConsoleApplication1, Configuration: Debug Win32 —----
1>A task was canceled.
1>A task was canceled.
========= Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Just to be complete,
Closing and reopening Visual Studio worked for me after I had changed the time zone and was getting the same errors as you.
I encountered the same error when I installed VS2013 update 5. During the installation my VS was open. Prior to installation of the update, I was asked to close VS but I neglected. That might have been the reason for the error although not sure about the exact cause.
After installation, the installer prompted me to restart the computer and the error was gone after I restarted my computer.
I am encountering similar problem with VS2015 update 3. Once this start happening I can't build application and can't start another instance Visual studio as it gives out of memory exception.
After looking through task lists I found out that there are many instance of conhost.exe and MSBuild.exe processes. So as temporary fix I kill all instances and try again building it is not perfect solution but works some times.
You can try run following batch commands.
Taskkill /IM MSBuild.exe /F
Taskkill /IM conhost.exe /F
Changed the time zone of system (Start>Settings>Time&language>Date&time>Time zone) to automatic, and then restarted the VS2019(on this I was facing the issue) in administrator mode. Issue got resolved for me.
I had the "A task was cancelled" error, not after updating Visual Studio or changing the time clock, but when enabled editing to a file from my version control software.
Likewise, reloading Visual Studio fixed the error.
I am starting to learn this type of programming (driver programming) since a short while of the time.
I started by using the traditional way _> I mean I only used WDK to bulid and compiled driver and was working properly with simple method of projects but I faced small problems in advanced when i wanted to start to expand my program or make a little developed one.
So, I started using VS2010 in windows 7, I really faced a lot of problems because i do not have a background how can i used it as good as possible.
Finally, I reach to a good point, this point is say (If you want to start with driver programming in VS2010, 1- you should install WDK 2- install VS2010 3- Enter the paths of WDK headers dirctories into VS2010 Dirctories to be compatiple. 4- Start tor create new project and go on.
makefile project
Finally, I am really not sure, it is a correct way or not I am just beginner.
But I did like this and i found a good results
#include "wdm.h"
NTSTATUS DriverEntry( IN PDRIVER_OBJECT theDriverObject, IN PUNICODE_STRING theRegistryPath )
{
DbgPrint("Hello World!");
return STATUS_SUCCESS;
}
And i got:
1>------ Build started: Project: 1, Configuration: Debug Win32 ------ 1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(37,5): warning MSB8005: The property 'NMakeBuildCommandLine' doesn't exist. Skipping... ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
My question is:
Is this the correct way? How can I know this program is working properly?
Should I do something else to make my program work correctly in kernal mode?
Never build drivers in Visual Studio!
The only way to build driver is: open WDK Build Environment command prompt, cd to the driver project directory, and type "build".
You can use Visual Studio only as source code editor, but don't build driver with it! There are number of ways to do this, published in different programming sites, but professional driver developers strongly recommend to use only WDK build for this.
To open WDK build environment, click main Windows menu - Programs - Windows Driver Kits - WDK - Build Environments - select target OS - select build environment, according to target computer processor type. Checked build environment means Debug, free build environment means Release.
Look into DDKWizard. It tackles exactly the issue you're handling, and does it well.
You shouldn't use the compiler of Visual Studio. The WDK compiler may contain changes to the standard WinSDK or Visual Studio compiler.
On the other hand, using a build macro from the makefile step is a nice enough way to utilize Visual Studio for developing the driver, and building it with the build toolkit used by the WDK.
There is a nice batch file which calls the necessary build environment and redirects the error outputs to the Visual Studio output pane.
To clarify, I use a makefile project in visual studio where all source files are added, when building I call a batch file which calls in turn ddkbuild with the right parameters.