Project build error in Visual Studio - visual-studio-2005

I am getting the following error when building my project and have no idea what it means.
Environment: C++/CLI - VS2005
EDIT: Error message is "Project : error PRJ0003 : Error spawning 'resgen.exe'."
The weird thing is that it compiles other projects with the same configuration without any problems! I searched over the internet and it looks like it is caused by having VS2010 and VS2005 sitting together on the same machine. It is also said that reinstalling VS2005 fixes the problem.
Has any of you encountered this problem before? If yes, how did you fix it?

Just had the same problem and fixed it: resgen.exe resides in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin
however that directory was not in VS' path, only the v7.1 SDK dir was there and that version does not seem to have resgen.
Fixed simply by adding the above directory under `Tools->Options->Projects and Solutions->VC++ Directories->Executable Files', after the 7.1 dir to make sure things do not get messed up. My config looks like this now:
....
$(WindowsSdkDir)\bin
....
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin

Related

Libjna build - LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'

I'm re-posting an issue from github (https://github.com/libffi/libffi/issues/538) I had since last week.
I'm currently having issue getting some JNA libraries built as jar deployables using Ant build script (FYI: https://github.com/thepaul/libjna-java). in order to use the APIs from this library for my other project. (The sole purpose of me going through the hassle building it is to be able to use its API. Due to lack of documentation and absence of existing build artifact provided, I had to do it myself. Importing the whole libjna repo as a project into my other project maybe another approach but I don't think it's appropriate. That said, if there're any better ways to use the libraries in libjna, do let me know!)
So here's what I did trying to build it into deployable jar file:
I already have the source project downloaded.
Tried to compile using Ant (which I downloaded the latest version) on cygwin. Failed because it requires libffi.
So I downloaded libffi source from here (https://github.com/libffi/libffi).
Tried to compile again using Ant. Failed because it couldn't find "/c/Program Files (x86)/Microsoft Visual Studio 9.0/vc/bin/cl" as mentioned in the config.log
So I inspected cc.sh and found that it refers to an older version of Microsoft Visual Studio. I have an existing installation of Visual Studio Express. So I changed the path to "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64" in cc.sh file.
Tried to complile again using Ant. Seemed the fix worked but failed with different error because it couldn't find "mspdbcore.dll". I found this file in "..\x86" so I copy the file across to ..\x64
Tried to compile again using Ant. Failed with similar error but different file because it couldn't find "mspdb140.dll". I found this file in "..\x86" so I copied over
Tried to compile again. Failed with different error because now it says
"LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'"
, although I could confirm this file is definitely in "C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64"
To tackle this error I tried (in vain):
adding microsoft visual studio paths to PATH
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x64
C:\Program Files (x86)\Microsoft Visual
Studio\2017\WDExpress\VC\Tools\MSVC\14.16.27023\lib\x64
C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\Common7\IDE
Downloaded MS Visual Studio 2019 both Community and Professional (couldn't find those dlls for some reason)
Downloaded both mspdb140.dll and mspdbcore.dll separately, config.log says it can't find these files
Note I also did some research online, however:
I don't use visual studio IDE as I"m only trying to build it with Ant, so this post didn't really help much (LINK: fatal error LNK 1104: cannot open file 'LIBCMT.lib')
I don't really understand the answer to this post either (https://social.msdn.microsoft.com/Forums/en-US/cbedc1ba-c50b-499e-aa2e-12b0ce6a40ba/lnk1104-cannot-open-file-libcmtlib?forum=vclanguage)
So this is where I'm stuck.
See latest config log attached.
config.log
Also Ant build log attached.
ant_compile_error.txt
Anyone can help would be much appreciated!
Cheers
Dale

Visual Studio 2017 fails to build project using msbuild

I am trying to build this project which generates a minified css file for my website, I moved the project files to a new PC with a new version of Visual Studio (2017 from 2010) and after some small issues I got solved, I am now feeling stumped. This is the error:
Error The command "C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe
"C:\Users\Dennis\Documents\Visual Studio
2017\Projects\minify-CSS\minify-CSS\MSbuild\msbuild.xml"
/p:ConfigurationName=Release" exited with code 9009.
I know the error is in the path, there's a space in the path and there's no citation marks around the path. I don't know why VS2017 fails at this. I navigated to the msbuild folder in the command prompt and ran the build command manually, the project compiled just fine. Anyone know where I can correct this so the path is put in citation marks, or otherwise get around this?
I got it to work. I opened the project file and found this line:
<PostBuildEvent>$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)MSbuild\msbuild.xml" /p:ConfigurationName=$(ConfigurationName)</PostBuildEvent>
I just added citation marks around the first part and it started working. Like this
<PostBuildEvent>"$(MSBuildBinPath)\msbuild.exe" "$(ProjectDir)MSbuild\msbuild.xml" /p:ConfigurationName=$(ConfigurationName)</PostBuildEvent>

error Build: File 'COMPUTE_PATHS_ONLY.ts' not found in visual studio

I received the following error after the repair of visual studio 2015.
Error Build: File 'COMPUTE_PATHS_ONLY.ts' not found.
COMPUTE_PATHS_ONLY.ts is not from my Git repo. Other files in the Git repo have not changed. What could it be?
I found answer here, it works for me: https://github.com/Microsoft/TypeScript/issues/7445
the error indicates that there is a mismatch between your targets (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets) and the tasks dll (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\TypeScript.Tasks.dll); this would be an issue with the installer not handling a specific order of installing different versions.
Can please try:
uninstall TS 1.8.* from Add/Remove Programs
uninstall TS 1.7.* from Add/Remove Programs
make sure the folder C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript is empty, if not remove it manually
install TS 1.7.6 again, you should see the folder created in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript
For me the solution was to move the folder at
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript
to
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript
and overwrite everything there.
This answer helped me a lot, I could solve my problem this way
When I removed "COMPUTE_PATHS_ONLY" from the
line Configurations="$(TypeScriptBuildConfigurations)
COMPUTE_PATHS_ONLY" in the file Microsoft.TypeScript.targets, my
problem was solved.
The steps mentioned above will not guarantee to fix your issue. After following the steps mentioned above I was keep getting the same compiler error.
I restarted my machine after "uninstall and install" operation but no luck.
Finally, I found that instead of doing all these from control panel we have to do it from package manager (Right Click on solution and select "Manage Nuget packages for solution.."
First uninstall the TS package for your project from package manager and then install the package and build.
Img of project setting
I was using the VS 2015 update_1 and type script version 1.8
For me it was solved by updating VS 2015 in update_3
https://msdn.microsoft.com/en-us/library/mt752379.aspx

Setting up Windows SDK in VS2012 Windows7

I'm trying to set up Windows SDK for DirectX11 but having a bit of trouble.
I'm on Windows7 with Visual Studio 2012.
The error I'm getting is:
1>TRACKER : error TRK0005: Failed to locate: "fxc.exe". The system cannot find the file specified.
So I assume it isn't locating the SDK correctly (I think it's an HLSL error).
So far in my project directories I have:
Include directories: $(WindowsSDK_IncludePath)
Library directories: $(WindowsSDK_LibraryPath_x86)
Library WinRT directories: $(WindowsSDK_MetadataPath)
I've checked where these macros go, and they go to the right place:
C:\Program Files(x86)\Windows Kits\8.0\etc...
which is where I installed it, however the error I wrote above is still showing up.
I'm stumped as to what to do next, could anybody help?
It is located in C:\Program Files(x86)\Windows Kits\8.0\bin\x86\fxc.exe, first check if it is there.
The VS setting that matters is Project + Properties, VC++ Directories, Executable Directories. It normally includes $(WindowsSDK_ExecutablePath_x86) so should never have a problem locating the file.

MVVM Light obtained via NuGet - RelayCommand.cs not found

My program incorporates a copy of MVVM Light via NuGet. Up until about 5 minutes ago it worked without a hitch, but now I'm getting an error saying "RelayCommand.cs not found". Since I got the package from NuGet, I don't have RelayCommand.cs itself, just the dll. I have tried uninstalling and reinstalling MVVM Light and the problem persists. Right now I really am at a loss. If anybody could help me fix this so that I can continue working I would greatly appreciate it.
Locating source for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'. Checksum: MD5 {9c e1 3c 59 78 15 34 23 2b e 9b 39 ef 5d eb d0}
The file 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs' does not exist.
Looking in script documents for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'...
Looking in the projects for 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\vccorlib\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: d:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs.
The debugger could not locate the source file 'd:\GalaSoft\mydotnet\MvvmLight\Source\GalaSoft.MvvmLight\GalaSoft.MvvmLight (NET35)\Command\RelayCommand.cs'.
Update: At this point I'm thinking that this is a problem with VS. I downloaded the dll files manually and referenced them and I'm still getting the same error. I'm thinking it might just be worth it to make a new project and migrate my data. If anybody has any ideas on how to fix this, though, I'm all ears.
Update: I don't know if this could be the issue, but it appears that the program is looking for MvvmLight (NET35). The version I obtained (and had working up until now) is WPF45.
Update: When I open packages.config in my solution, I get a warning that says "The 'packages' element is not declared." Could this be relevant?
Got just the same Problem with Galasoft and found your post. - Finally I figured it out, or at least the error no longer pops up:
Go to Tools-Options...-Debugging-General and tick Enable Just My Code and the error disappeared. I assume MVVM-Light is compiled in Debug Mode and now Visual Studio Looks for the MvvmLight pdb and cs file which are of course not there when installed via nuget.
I don't know why this would cause such an error, but I believe it was caused by trying to read in data from a file that didn't exist. I removed that code and the error went away.
When I got this error it was because of an invalid cast exception. I had this:
MyCommand = new RelayCommand<int>((i) => MyMethod(i));
But the property I was Binding in my XAML was a long. I changed it to this and it worked:
MyCommand = new RelayCommand<long>((i) => MyMethod(i));

Resources