Windows编译FreeRDP

  • 需要准备的工具
  • 1、安装CMake (cmake-gui)
  • 2、安装`Visual Studio Community 2017`
  • 3、下载`FreeRDP`源码
  • 4、下载`libusb`
  • 5、安装`openssl `
  • 生成VS解决方案
  • 1、配置FreeRDP源码和生成路径
  • 2、选择要生成的解决方案
  • 3、配置libusb路径
  • 4、生成解决方案
  • 编译FreeRDP解决方案
  • 1、修改项目属性
  • 2、编译解决方案
  • 3、测试
  • 4、使用`wfreerdp.exe`时需要打包的dll(Release版)


Windows编译FreeRDP

需要准备的工具

1、安装CMake (cmake-gui)

下载地址 https://cmake.org/download/

windows如何使用grep Windows如何使用freerdp_下载地址

2、安装Visual Studio Community 2017

下载地址 https://visualstudio.microsoft.com/zh-hans/vs/older-downloads/

windows如何使用grep Windows如何使用freerdp_下载地址_02

3、下载FreeRDP源码

下载地址https://github.com/FreeRDP/FreeRDP

windows如何使用grep Windows如何使用freerdp_windows_03

4、下载libusb

下载地址 https://libusb.info/Downloads -> Latest Windows Binaries

windows如何使用grep Windows如何使用freerdp_windows_04

5、安装openssl

下载地址 http://slproweb.com/products/Win32OpenSSL.html

windows如何使用grep Windows如何使用freerdp_windows_05

生成VS解决方案

1、配置FreeRDP源码和生成路径

windows如何使用grep Windows如何使用freerdp_windows_06


F:\IoT\FreeRDP是源码目录,F:\IoT\FreeRDP.build是生成的工程目录。

2、选择要生成的解决方案

点击Configure弹出如下图的界面,选择要生成的解决方案,点击Finish开始配置。

windows如何使用grep Windows如何使用freerdp_下载地址_07


等待一段时间会报错,查看错误信息,发现libusb路径没有配置。

windows如何使用grep Windows如何使用freerdp_c++_08


配置libusb路径

windows如何使用grep Windows如何使用freerdp_c++_09

3、配置libusb路径

windows如何使用grep Windows如何使用freerdp_windows_10


点击Configure等待Configuring done

windows如何使用grep Windows如何使用freerdp_解决方案_11

4、生成解决方案

点击Generate生成解决方案,等待输出Generating done

windows如何使用grep Windows如何使用freerdp_解决方案_12

编译FreeRDP解决方案

1、修改项目属性

点击Open Project打开解决方案

修改freerdp-client项目属性

属性->链接器->输入->附加的依赖项中增加

…\Debug\libusb-1.0.lib

windows如何使用grep Windows如何使用freerdp_下载地址_13


F:\IoT\libusb\MS64\dll下的全部文件复制到F:\IoT\FreeRDP.build\Debug注:编译Release版本,按上面的方法修改Release属性即可。

2、编译解决方案

F7生成解决方案

Debug目录下生成的wfreerdp.exe就是RDP客户端。

windows如何使用grep Windows如何使用freerdp_下载地址_14

3、测试

创建快捷方式:

windows如何使用grep Windows如何使用freerdp_c++_15

修改目标:
F:\IoT\FreeRDP.build\Debug\wfreerdp.exe /u:admin /p:123456 /w:1366 /h:768 /v:192.168.1.111:3389 /f 命令行参数说明:
/u:admin用户名/p:123456密码/w:1366/h:768/v:192.168.1.111:3389远程主机IP和端口/f全屏窗口。

4、使用wfreerdp.exe时需要打包的dll(Release版)

windows如何使用grep Windows如何使用freerdp_c++_16