Using LibTiff in Visual Studio 2010 - c++

I'm trying to use LibTiff in a C++ Program in Visual Studio 2010. I downloaded tiff-3.9.2.zip from ftp://ftp.remotesensing.org/pub/libtiff. To test LibTiff it would be nice if someone could give me a step by step instruction how to import libtiff to visual Studio and build the Fax2Tiff tool.
There are so many files so that I am totally confused.
What I already have done:
1) Created a new Empty Win32 Console Application Project named "TiffTest"
2) Copied the folder "libtiff" from the tiff-3.9.2.zip to the Project Folder
3) Copied the file "fax2tiff.c" to the Project Folder
4) Added those files to the Project
5) Added the "libtiff" folter to the additional include folders
6) Renamed the files "tif_config.vc.h" and "tiffconf.vc.h" to "tif_config.h" and "tiffconf.h"
7) Tried to compile it.
This does not really work. All I do to get rid of the error messages causes new error messages. Can anyone tell me how I can get libtiff to work?
I really need help...
Thank you so much!

I think it would be better
to build libtiff as a static library.
to build fax2tiff as a console application that links with the library
In addition, you should decide which version of the file- and memory-related files you want to use in your version of the library. There are Unix, DOS and Windows-style versions for file- and memory related files.
And for fax2tiff you will probably need Windows version of the getopt.c and getopt.h files. You may use wingetopt.h and wingetopt.c found on koders.com
I successfully use libtiff-3.9.4 and tiff2pdf built using this approach.
Btw, libtiff version 3.9.4 is most recent one in 3.x branch.
Below is the part of my LibTiff.vcxproj. It shows which files are needed to build libtiff on Windows using Visual Studio 2010.
<ItemGroup>
<ClInclude Include="t4.h" />
<ClInclude Include="tiff.h" />
<ClInclude Include="tiffconf.h" />
<ClInclude Include="tiffio.h" />
<ClInclude Include="tiffiop.h" />
<ClInclude Include="tiffvers.h" />
<ClInclude Include="tif_config.h" />
<ClInclude Include="tif_dir.h" />
<ClInclude Include="tif_fax3.h" />
<ClInclude Include="tif_predict.h" />
<ClInclude Include="uvcode.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="tif_aux.c" />
<ClCompile Include="tif_close.c" />
<ClCompile Include="tif_codec.c" />
<ClCompile Include="tif_color.c" />
<ClCompile Include="tif_compress.c" />
<ClCompile Include="tif_dir.c" />
<ClCompile Include="tif_dirinfo.c" />
<ClCompile Include="tif_dirread.c" />
<ClCompile Include="tif_dirwrite.c" />
<ClCompile Include="tif_dumpmode.c" />
<ClCompile Include="tif_error.c" />
<ClCompile Include="tif_extension.c" />
<ClCompile Include="tif_fax3.c" />
<ClCompile Include="tif_fax3sm.c" />
<ClCompile Include="tif_flush.c" />
<ClCompile Include="tif_getimage.c" />
<ClCompile Include="tif_jbig.c" />
<ClCompile Include="tif_jpeg.c" />
<ClCompile Include="tif_luv.c" />
<ClCompile Include="tif_lzw.c" />
<ClCompile Include="tif_next.c" />
<ClCompile Include="tif_ojpeg.c" />
<ClCompile Include="tif_open.c" />
<ClCompile Include="tif_packbits.c" />
<ClCompile Include="tif_pixarlog.c" />
<ClCompile Include="tif_predict.c" />
<ClCompile Include="tif_print.c" />
<ClCompile Include="tif_read.c" />
<ClCompile Include="tif_strip.c" />
<ClCompile Include="tif_swab.c" />
<ClCompile Include="tif_thunder.c" />
<ClCompile Include="tif_tile.c" />
<ClCompile Include="tif_unix.c" />
<ClCompile Include="tif_version.c" />
<ClCompile Include="tif_warning.c" />
<ClCompile Include="tif_write.c" />
<ClCompile Include="tif_zip.c" />

Related

Linux-MSBuild-project not starting in VisualStudio

I have a basic MSBuild project in c++ for Linux. I was able to compile and debug it without any problems until I re-installed Debian on the server. I have since installed g++, GCC, gdb, gdbserver, make, rsync, and zip.
Visual-Studio compiles the project remotely without any problems, but when it tries to start it, I get the following prompt.
I tried using different versions of Visual-Studio, like prev2022 and 2019, and installing Linux on a completely different machine in my network.
Here is the content of the .vcxproj file:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{63047eae-971e-48d1-b78a-91ea7faeda86}</ProjectGuid>
<Keyword>Linux</Keyword>
<RootNamespace>xy</RootNamespace>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<ApplicationType>Linux</ApplicationType>
<ApplicationTypeRevision>1.0</ApplicationTypeRevision>
<TargetLinuxPlatform>Generic</TargetLinuxPlatform>
<LinuxProjectType>{D51BCBC9-82E9-4017-911E-C93873C4EA2B}</LinuxProjectType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<UseOfStl>libstdc++_shared</UseOfStl>
<RemoteRootDir>~/debug</RemoteRootDir>
<PlatformToolset>Remote_GCC_1_0</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<RemoteCopySourceMethod>rsync</RemoteCopySourceMethod>
<RemoteCCompileToolExe>g++</RemoteCCompileToolExe>
<RemoteCppCompileToolExe>g++</RemoteCppCompileToolExe>
<ValidateArchitecture>true</ValidateArchitecture>
<MultiProcNumber>4</MultiProcNumber>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="AuthorizationManager.cpp" />
<ClCompile Include="Cookie.cpp" />
<ClCompile Include="CreateDirectoryModule.cpp" />
<ClCompile Include="DeleteDirectoryModule.cpp" />
<ClCompile Include="Directory.cpp" />
<ClCompile Include="FileHelper.cpp" />
<ClCompile Include="FileSystemManager.cpp" />
<ClCompile Include="FileUploadManager.cpp" />
<ClCompile Include="FinishModule.cpp" />
<ClCompile Include="HttpRequest.cpp" />
<ClCompile Include="HttpRequestCreator.cpp" />
<ClCompile Include="HttpResponse.cpp" />
<ClCompile Include="HttpServer.cpp" />
<ClCompile Include="LoginModule.cpp" />
<ClCompile Include="LogoffModule.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="MoveDirectoryModule.cpp" />
<ClCompile Include="NavModule.cpp" />
<ClCompile Include="ParentModule.cpp" />
<ClCompile Include="PathHelper.cpp" />
<ClCompile Include="PauseModule.cpp" />
<ClCompile Include="RefreshModule.cpp" />
<ClCompile Include="RenameDirectoryModule.cpp" />
<ClCompile Include="ResumeModule.cpp" />
<ClCompile Include="SocketListener.cpp" />
<ClCompile Include="StartModule.cpp" />
<ClCompile Include="StopModule.cpp" />
<ClCompile Include="StringCompairer.cpp" />
<ClCompile Include="StringConverter.cpp" />
<ClCompile Include="Timer.cpp" />
<ClCompile Include="UserManager.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AuthorizationManager.h" />
<ClInclude Include="byte.h" />
<ClInclude Include="byteSection.h" />
<ClInclude Include="Cookie.h" />
<ClInclude Include="CreateDirectoryModule.h" />
<ClInclude Include="DeleteDirectoryModule.h" />
<ClInclude Include="Directory.h" />
<ClInclude Include="FileHelper.h" />
<ClInclude Include="FileInfo.h" />
<ClInclude Include="FileSystemManager.h" />
<ClInclude Include="FileUploadManager.h" />
<ClInclude Include="FinishModule.h" />
<ClInclude Include="HttpMethod.h" />
<ClInclude Include="HttpModule.h" />
<ClInclude Include="HttpRequest.h" />
<ClInclude Include="HttpRequestCreator.h" />
<ClInclude Include="HttpRequestHandler.h" />
<ClInclude Include="HttpResponse.h" />
<ClInclude Include="HttpServer.h" />
<ClInclude Include="LoginModule.h" />
<ClInclude Include="loginResult.h" />
<ClInclude Include="LogoffModule.h" />
<ClInclude Include="MoveDirectoryModule.h" />
<ClInclude Include="NavModule.h" />
<ClInclude Include="ParentModule.h" />
<ClInclude Include="PathHelper.h" />
<ClInclude Include="PauseModule.h" />
<ClInclude Include="RefreshModule.h" />
<ClInclude Include="RenameDirectoryModule.h" />
<ClInclude Include="RequestHandler.h" />
<ClInclude Include="ResumeModule.h" />
<ClInclude Include="serverSettings.h" />
<ClInclude Include="SocketListener.h" />
<ClInclude Include="SortedVectorHelper.h" />
<ClInclude Include="StartModule.h" />
<ClInclude Include="StopModule.h" />
<ClInclude Include="StringCompairer.h" />
<ClInclude Include="StringConverter.h" />
<ClInclude Include="Timer.h" />
<ClInclude Include="uid.h" />
<ClInclude Include="UploadFile.h" />
<ClInclude Include="User.h" />
<ClInclude Include="UserCredentials.h" />
<ClInclude Include="UserManager.h" />
</ItemGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<OptimizeforMemory>false</OptimizeforMemory>
<AdditionalOptions>-pthread %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<CppLanguageStandard>c++17</CppLanguageStandard>
<CLanguageStandard>c11</CLanguageStandard>
<AdditionalOptions>
</AdditionalOptions>
<PreprocessorDefinitions>
</PreprocessorDefinitions>
</ClCompile>
<PostBuildEvent>
<Message>xy</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<AdditionalOptions>-pthread %(AdditionalOptions)</AdditionalOptions>
</Link>
<ClCompile>
<UnrollLoops>true</UnrollLoops>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
...and of the .vcxproj.user file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebuggerFlavor>LinuxDebugger</DebuggerFlavor>
<RemoteDebuggerWorkingDirectory>{the-path}</RemoteDebuggerWorkingDirectory>
<RemoteDebuggingTarget>{my-ip}(username={my-user-name}, port=22, authentication=None)</RemoteDebuggingTarget>
<RemoteGDBPath>
</RemoteGDBPath>
</PropertyGroup>
</Project>

error MSB8052: MSVC Toolset Version '14.28.29333' is not compatible with 'v120' Platform Toolset

I have been facing this issue since long, I am trying to build a project in VS 2019 which has previously built fine in vs 2013. I am facing this error which has no definition anywhere on Microsoft forums.
I have tried doing all the retargeting with the 2019 toolset as well as changing the toolset version to current in the project configuration file with no success at all.
I am not sure why even microsoft forums doesnot have any explanation for this error code (error MSB8052)
Also, the project still shows visual studio 2013 written in brackets in front of the project name. I have changed all the toolset to use the 2019 version but this is not changing.
The error is as follows : error MSB8052: MSVC Toolset Version '14.28.29333' is not compatible with 'v120' Platform Toolset. Please either change Platform Toolset to v142 or MSVC Toolset Version (VCToolsVersion property) to the version with the format '12.0*.*'. To use default MSVC Toolset Version for a given Platform Toolset don't set VCToolsVersion property.
I don't know somehow, it is still using the old platform toolset. Can somebody help me with this ?
enter code here
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Matrix">
<MatrixProjectDir>..\..\..</MatrixProjectDir>
</PropertyGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{173A4A3E-C861-4013-9366-08716BF7BCCD}</ProjectGuid>
<RootNamespace>LogicNpcUnmanagedSupport</RootNamespace>
<SccProjectName>SAK</SccProjectName>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
<SccProvider>SAK</SccProvider>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\Build\PropertySheets\MatrixReleaseSettings.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\Build\PropertySheets\MatrixDebugSettings.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\Include;$(ProjectDir)\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_COMPILING_NPC_LIB_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)ag$(ProjectName).lib</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\Include;$(ProjectDir)\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_COMPILING_NPC_LIB_;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Lib>
<OutputFile>$(Configuration)\ag$(ProjectName).lib</OutputFile>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="agGuid.cpp" />
<ClCompile Include="agLogicNpcBuffer.cpp" />
<ClCompile Include="agLogicNpcCallForwarder.cpp" />
<ClCompile Include="agLogicNpcClient.cpp" />
<ClCompile Include="agLogicNpcDispatcher.cpp" />
<ClCompile Include="agLogicNpcException.cpp" />
<ClCompile Include="agLogicNpcHeader.cpp" />
<ClCompile Include="agLogicNpcServer.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="agArrayWrapper.h" />
<ClInclude Include="agArrayWrapperComposite.h" />
<ClInclude Include="agArrayWrapperPrimitive.h" />
<ClInclude Include="agGuid.h" />
<ClInclude Include="agLogicNpcBuffer.h" />
<ClInclude Include="agLogicNpcCallForwarder.h" />
<ClInclude Include="agLogicNpcClient.h" />
<ClInclude Include="agLogicNpcContentFlags.h" />
<ClInclude Include="agLogicNpcDispatcher.h" />
<ClInclude Include="agLogicNpcException.h" />
<ClInclude Include="agLogicNpcHeader.h" />
<ClInclude Include="agLogicNpcServer.h" />
<ClInclude Include="agLogicNpcServerInfo.h" />
<ClInclude Include="agLogicNpcTransport.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
enter code here - MatrixDebugSettings.props
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="MatrixBaseSettings.props" />
<Import Project="MatrixMultiProcessorOptionSetting.props" />
<Import Project="MatrixDebugBaseSettings.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
</PropertyGroup>
</Project>
enter code here - Microsoft.Cpp.x64.user.props
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup />
</Project>
You can directly open vcxproj file, then confirm and modify Platform Toolset to V142
If it doesn't work, you could try to delete .vs folder which is next to your sln file.

Move existing file entries to project filter folders with visual studio

I am creating a C++ Visual Studio project.
I created a filter for all the headers and one for sources files. My files are in a folder with many sub folders.
Is there a way to add recursively all files *.h in my header folder and all the *.cpp in the source folder ?
My project :
The simplest solution for your problem seems to select each of the file entries in the Project-Explorer view, and drag and drop them to the filter folder you want them appearing.
Regarding to add new items you can select multiple files from the open file dialog, but you need to address each subdirectory separately.
Another option I could think of is to edit the .vxcproj.filters file directly in an appropriate text editor, or with a (XML) text processing tool.
If I open my projects .vxcproj.filters file in Notepad++ the relevant snippets look like this:
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Registry.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CommandId.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CommandBase.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Command1.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Command2.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CRTPSelfRegister.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>

msbuild Link step doesn't run

I'm trying to build a very simple C program using MSBuild. Previously this was put together by an intern using Visual Studio but we are not going to be using VS here and I want this built with MSBuild so I can automate it.
I have constructed my vcxproj file from scratch following the walkthrough on MSDN and the other reference docs there. I am able to compile the obj files no problem but the Link step never seems to run so I am not getting an executable output.
There is a function called main in AppDrv.c files, is it safe to assume that will be detected by the linker as the entry point, or do I need to tell msbuild manually some how that this is there?
Here is the entirety of my vcxproj. I can't find anything in the docs that says I need to tell it to link, shouldn't it happen automatically if the CL step completes OK? Do I need to somehow explicitly list the obj files to link, or can MSBuild figure that out on its own?
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
<PropertyGroup>
<ConfigurationType>Console</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<!--Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(UniversalCRT_IncludePath)$(ProjectDir)helper\include;$(WindowsSDK_IncludePath)$(VC_IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<CompileAs>CompileAsC</CompileAs>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>slip_windows_helper.exe</OutputFile>
<ShowProgress>LinkVerbose</ShowProgress>
</Link>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(UniversalCRT_IncludePath)$(ProjectDir)helper\include;$(WindowsSDK_IncludePath)$(VC_IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<CompileAs>CompileAsC</CompileAs>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="$(ProjectDir)helper\src\AppDrv.c" />
<ClCompile Include="$(ProjectDir)helper\src\Buffers.c" />
<ClCompile Include="$(ProjectDir)helper\src\SingleThreadAsync.c" />
<ClCompile Include="$(ProjectDir)helper\src\Slip.c" />
<ClCompile Include="$(ProjectDir)helper\src\Utils.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(ProjectDir)helper\include\AppDrv.h" />
<ClInclude Include="$(ProjectDir)helper\include\Buffers.h" />
<ClInclude Include="$(ProjectDir)helper\include\SingleThreadAsync.h" />
<ClInclude Include="$(ProjectDir)helper\include\Slip.h" />
<ClInclude Include="$(ProjectDir)helper\include\Utils.h" />
<ClInclude Include="$(ProjectDir)helper\include\SharedHeader.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
<Target Name="Info">
<Message Text="Target to output MSBuild information" />
<Message Text="OutputAssembly: $(OutputAssembly)" />
<Message Text="VCTargetsPath: $(VCTargetsPath)" />
<Message Text="Includes: $(IncludePath)" />
<Message Text="VC_IncludePath:$(VC_IncludePath)" />
<Message Text="WindowsSDK_IncludePath:$(WindowsSDK_IncludePath)" />
<Message Text="the property config is: $(Configuration)" />
<Message Text="final output directory: $(OutDir)" />
</Target>
</Project>
Here is the command I'm using to launch the build:
MSBuild.exe slipwinhelper.vcxproj /p:configuration=Debug /p:platform=Win32 /p:OutDir=target\ /nologo /t:Clean;Build;Info
UPDATE:
I got it to run the link task by overriding the AfterBuild event:
<Target Name="AfterBuild">
<Link Sources="Debug\AppDrv.obj;Debug\Buffers.obj;Debug\SingleThreadAsync.obj;Debug\Slip.obj;Debug\Utils.obj" />
</Target>
But now it is giving me unresolved externals on SetupApi calls in the code. I have tried changing the SubSystem to Windows, that doesn't seem to work.
A quick comparision with a VS generated files shows a bunch of differences/lacking properties, including the file from VS having
<ConfigurationType>Application</ConfigurationType>
whereas you are speciyfing Console which is not something msbuild recognizes.

Unmovable files in VS2010 project

I've got a Visual Studio 2010 C++ project. Previously everything was working fine but now when I create new files, they have strange little arrows in the corners. I've checked and they are not links, the files are at the hard location referenced. I've been through the project file and settings and cannot determine what on earth the difference is between them and my normal, good files. However, when I try to move these files to re-organize my project, Visual Studio won't move them. How can I solve this problem?
Here's (part of) the project file:
<ItemGroup>
<ClInclude Include="Interfaces\OS\OS.h" />
<ClInclude Include="Interfaces\Render\Math\colour.h" />
<ClInclude Include="Interfaces\Render\Math\Point.h" />
<ClInclude Include="Interfaces\Render\Math\rectangle.h" />
<ClInclude Include="Interfaces\Render\render.h" />
<ClInclude Include="Implementations\OS\Windows\Context.h" />
<ClInclude Include="Implementations\OS\Windows\Window.h" />
<ClInclude Include="Implementations\OS\Windows\Windows.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Context.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Direct3D9.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Font.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Label.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Scene.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Sprite.h" />
<ClInclude Include="Implementations\Render\Direct3D9\Texture.h" />
<ClInclude Include="UI\Context.h" />
<ClInclude Include="UI\Controls\Button.h" />
<ClInclude Include="UI\Controls\Context.h"/>
<ClInclude Include="UI\Division.h" />
</ItemGroup>
As you can see, all of the header files are listed equally, but only some of them are unmovable.
Apparently, this is something special. The problem only occurs if the root folder is named "UI". All other folder names work as expected. Re-creating the folder and files has no effect, but if the root folder is not named "UI", then everything correct. Going to chalk this one up to a Visual Studio error.