I'm working on a script that generates Visual Studio 2005 C++ project files (.vcproj).
The script reads a makefile, then spits out a c++ project.
INPUT: makefile ---> OUTPUT: VS 2005 c++ project (.vcproj)
However, when I try to build the auto-generated project in VS 2005, error outputs: "Unspecified Error." Evidently, I am not generating the VS 2005 .vcproj file correctly.
Assuming that my c++ project file was malformed, I opened up VS 2005 and made a new C++ project. I actually copied the good, VS 2005-created project file to my non-working, malformed project file. I replaced the Name, Reference Includes (.libs), Compile Includes (.cc, .c), etc. in the good VS 2005 project with my malformed project file's information.
However, I still cannot get VS 2005 to compile my .vcproj. Perhaps VS 2005 is very particular about the content of its .vcproj's?
Please give me advice on how to manually generate a VS 2005 .vcproj.
Thanks!
The project files are in the MSBuild format, which is a XML file format with a schema (XSD). You can verify your generated files against this schema. Follow the instructions here:
http://blogs.msdn.com/b/msbuild/archive/2005/11/04/489212.aspx
to locate the schema files and then grab your favored tool schema verification tool to validate your tool's output. A discussion about schema validation tools is here:
XML Schema (XSD) validation tool?
Related
I've been given a Visual Studio project which has come with the following files:
myproj.def
myproj.dsp
myproj.dsw
myproj.idl
myproj.vcxproj
myproj.vcxproj.filters
After reading the Project and Solution Files Microsoft Docs it says for Projname.vcxproj:
The project file. It stores information specific to each project. (In earlier versions, this file was named Projname.vcproj or Projname.dsp.) For an example of a C++ project file (.vcxproj), see Project Files.
And this Microsoft Docs page says:
For convenience, Microsoft Visual Studio 6.0 provides a project file for each sample. This file has the DSP extension. An Allsamp.dsw workspace file is also provided in the main directory so that you can compile all the samples at once from within Visual Studio.
Does that mean that if I have the .vcxproj file, I can safely delete the .dsp and .dsw files?
Assume I do not care to ever recompile using Visual Studio 6.0 in the future.
.sln is equivalent to .dsw in VC6.0
.vcxproj is equivalent to .dsp in VC6.0
As far as I'm concerned ,if you have the .vcxproj file , you can safely delete the .dsp and .dsw files?
I'm feeling like an eejit right now. I have been using Visual Studio 2010 Professional successfully for C/C++ projects for quite some time. But now I have a project that also includes a couple of ASM files (written for the Microsoft Assembler). I read a few articles about enabling MASM in Visual Studio. I followed the instructions for checking the boxes for MASM and MASM64 in the project's Build Customizations. Then I saved the Project and reopened it. But now it cannot load the project and gives this error message:
The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm64.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.
Where do I find this masm64.targets file or how do I create it? It is not anywhere on the disk.
Thanks for any guidance.
A tip for anyone who runs into the same problem, I found masm64.targets on GitHub:
https://github.com/MMOCOM/OSIE-GF/blob/master/Rules/masm64.targets
We made the switch to Visual Studio 2017 and having trouble with our self-hosted build agent that gets its work from VSTS.
One VSTS-build step is building all solutions with "Visual Studio Build: Build Solution ***.sln" using "Visual Studio Version: Visual Studio 2017".
The following error happens for all our projects where "ASP.NET Core Web Application (.NET Core)" was the chosen project type.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(54,5): error MSB4062: The "TransformWebConfig" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0....\tools\net46\Microsoft.NET.Sdk.Publish.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\tools\net46\Microsoft.NET.Sdk.Publish.Tasks.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Additional information:
From within Visual Studio 2017 the solutions built without any errors.
None of our projects include any .config transformations files (but do include .config files like web.config), still the error occurs.
Visual Studio 2017 Build Tools as well as full Visual Studio 2017 have been installed on the build server and e.g. .NET Core Class Libraries compile fine.
Installed .NET Core versions are identical between build server and developer machines.
The same errors also happen when using "MsBuild: Build Solution ***.sln" as a build step for all solutions and selecting "MSBuild: MSBuild 15.0".
The file mentioned as "Could not load file or assembly: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\tools\net46\Microsoft.NET.Sdk.Publish.Tasks.dll" does exist in the mentioned path.
No tasks are defined within the .csproj files.
Anyone got any insight as to what might cause this?
Have a look below:
https://github.com/aspnet/websdk/pull/174
I have reported the same behavior, and it turns out to be an issue only in the 64bit version of the MSBuild, switching back to the 32bit one worked for me, until this gets fixed.
Have a look at this link. It looks like the issue was previously fixed
https://github.com/Microsoft/msbuild/issues/1010
However, recently another change was made to MSBuild (referenced from above). My hunch is this 'downgrade' is causing the 'fix' to be ignored (wrong DLL ver is being used)
https://github.com/aspnet/Scaffolding/pull/321
so I have downloaded a template from the tutorial website http://devmaster.net/posts/introduction-to-c-with-game-development-part-2-project-template
however I have a problem because the template was apparently made in Visual Studio 2008, and I have Visual Studio 2010. When I convert the project I get the error "Unable to start program'C:\c++\Debug\Template.exe' The system cannot find the file specified."
I looked in the original file before conversion and the \Debug\Template.exe file does exist, however after converting the file it gets deleted. I had a few warnings on my conversion and I found this:
"MSB8012: $(TargetPath) ('C:\c++\Debug\Template.exe') does not match the Linker's OutputFile property value 'Template_debug.exe' ('C:\c++\Template_debug.exe') in project configuration 'Debug|Win32'."
Any idea how to fix this?
Any help would be very appreciated
How about creating a fresh project in Visual Studio 2010 and adding the source files and dependencies. Then compile and run, always works!
I am trying to use the gloox library (C++) to create a Windows XMPP application. It seems simple enough, except I don't know how to import gloox into Visual Studio 2010 so I can include it in my application project.
I've looked at the instructions provided in the read-me (shown below), but when I try to compile the library, I get this error:
Cannot open source file: 'src\tlsgnutlsserver.cpp': No such file or directory
Instructions provided in the read-me file:
Building gloox on MSVC++
use the included project file or create your own
adjust include + library paths if necessary
to receive any debug output you should use the LogSink facilities (this is not win32-specific)
build
Does anyone have experience using Gloox with VS10? If yes, can you please help me out? Thanks!
I assume you're using the official 1.0 tarball? I had the same problem (missing source file) and had to acquire the source from SVN instead. I used the 1.0 branch.
I encountered a few other build problems, namely
the release build configuration was set to build an Application (.exe) instead of Dynamic library (.dll) (Project->Properties->General->Configuration Type)
I needed to add DLL_EXPORT to the preprocessor definitions (Project->Properties->Configuration Properties->C/C++ ->Properties->Preprocessor)
src\atomicrefcount.cpp needed to be added to the project's source files. (Project->Add Existing Item)
This worked for me in express editions of both VC++ 2010 and VC++ 2008.
Hopefully it helps you as well.