TightVNC2.8.5在VS2010下编译和错误解决

一、编译:

tightvnc版本:tightvnc-2.8.5-src-gpl

编译工具IDE:VS2010

系统环境:Win7-32

库文件依赖:Windows Kits

下载链接:https://developer.microsoft.com/en-us/windows/downloads/windows-8-sdk


配置:
Two versions of the MS Visual Studio are supported. Choose the one of these files in the TightVNC distribution root folder and compile the source code.
  * MS Visual C++ 2010 (tightvnc2010.sln)
  * MS Visual C++ 2008 (tightvnc.sln)

Before building, Go to Tools -> Options -> Configuration Properties ->VC++ Directories. Replace the default values given below.

Make sure to change x86 for x64 if you are targeting 64-bit systems.
Here, the default location of Windows SDK is used (if you installed it in another location replace its path as well). --- 指的是 Windows Kits, 不是 Windows SDK
       TightVNC2.8.5在VS2010下编译和错误解决_第1张图片
  1. Choose Executable Directories and replace '$(WindowsSdkDir)bin'
  with '$(ProgramFiles)\Windows Kits\8.0\bin\x86'
  
  2. Choose Include Directories and add '$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared'
  at the beginning. Remove '$(WindowsSdkDir)include'.
  
  3. Choose Library Directories and replace '$(WindowsSdkDir)lib' with
  '$(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x86'.
  
  4. Choose Exclude Directories and replace '$(WindowsSdkDir)include'
  with '$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\
  Windows Kits\8.0\Include\shared'

(Windows Software Development Kit使用配置:https://blogs.msdn.microsoft.com/vcblog/2012/03/25/using-the-windows-software-development-kit-sdk-for-windows-8-consumer-preview-with-visual-studio-2010/


  关于上述替换删除操作,因为我的VS2010在上述页面进不去编辑界面,所以就把原先继承的父级取消,重新粘贴了一遍,如下图:

              TightVNC2.8.5在VS2010下编译和错误解决_第2张图片


二、错误解决:

(1)LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

        1、搜索计算机中的cvtres.exe(vs2010不一定安装在C盘),得到类似这样的目录:

            C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
            C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7601.17514_none_ba1c770af0b2031b
            C:\Windows\Microsoft.NET\Framework\v4.0.30319

        2、修改 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下的 cvtres.exe(随便一个名字)

        3、复制 C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7601.17514_none_ba1c770af0b2031b 目录下的 cvtres.exe 到C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下。

        4、OK,打开测试一下,如果不行,记得还原原来的文件。


(2)error MSB6006: “CL.exe”已退出

   From
     C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE

   Copy those files:
     msobj100.dll
     mspdb100.dll
     mspdbcore.dll
     mspdbsrv.exe
   to
     C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin



参考:

(1)http://blog.csdn.net/lonelyrains/article/details/41871615?utm_source=tuicool

(2)http://blog.csdn.net/rwang_1001/article/details/52931861

你可能感兴趣的:(源码学习,桌面虚拟化)