Cross-Compile FreeRDP using Mingw-w64

2023-05-16

Original: https://github.com/FreeRDP/FreeRDP/wiki/Compilation

FreeRDP can be compiled for Windows (32/64 Bit) on a Linux system using the Mingw cross-compilers. The following instruction was tested with Mingw-w64 2.0 and gcc-4.7 on Scientific Linux 6.1 (x64) but should work relatively independent of the Mingw/gcc version.

1. Install the Mingw-cross compilers (most Linux distros offer binary packages for Mingw in their repos). On older distros you may need to compile the latest version of Mingw from source. If you want to create 32 Bit binaries only, then Mingw32 is sufficient, otherwise you should install Mingw-w64.

2. Download the latest version of openssl (http://www.openssl.org/), compile it using the Mingw cross-compilers and install it. Instructions how to do this can be found on http://www.blogcompiler.com/.

3. Download FreeRDP and unpack the source archive. Create a subdirectory in the FreeRDP source tree called “mingw_build” where FreeRDP will be build. Open a terminal and goto this directory. Enter the command


cmake -DCMAKE_SYSTEM_NAME="Windows" \
      -DCMAKE_C_COMPILER="/opt/mingw64/bin/x86_64-w64-mingw32-gcc" \
      -DCMAKE_RC_COMPILER="/opt/mingw64/bin/x86_64-w64-mingw32-windres" \
      -DCMAKE_INSTALL_PREFIX="/opt/mingw64" \
      -DBUILD_SHARED_LIBS=OFF \
      -DCMAKE_C_FLAGS="-DFREERDP_EXPORTS -Dsprintf_s=snprintf" \
      -DCMAKE_EXE_LINKER_FLAGS="-L/opt/mingw64/lib" \
      -DWITH_SSE2=OFF \
      -DWITH_SSE2_TARGET=OFF \
      -DOPENSSL_INCLUDE_DIR="/opt/mingw64/include" \
      -DLIB_EAY="/opt/mingw64/lib/libcrypto.a" \
      -DSSL_EAY="/opt/mingw64/lib/libssl.a" \
      ..

This will configure FreeRDP for cross-compilation. Note that you need to adjust the paths according to your installation of Mingw and OpenSSL. Using the command above the wfreerdp.exe binary will be statically linked and can be executed on any Windows machine.

Note: You need a recent version of cmake (I used 2.8.7) as the logic in the FindOpenSSL cmake makro is broken (for cross-compilation) in older versions.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Cross-Compile FreeRDP using Mingw-w64 的相关文章

  • 在头文件中使用声明

    我一直在寻找有关使用的一些说明使用声明在头文件中 我正在四处搜索 但无法完全得到我正在寻找的答案 到目前为止我的研究得出的结论是 将它们用于非全局的范围是好的 而命名空间指令则不好 我明白 至少我希望如此 所以在我的例子中我使用shared
  • Qt Creator错误代码-1073741819

    好的 Qt Creator 和我尝试在 项目 gt 应用程序 gt Qt Gui 应用程序 下创建最基本的应用程序 项目创建成功 此外 当我编译它时 它似乎工作得很好 11 07 38 Running steps for project T
  • 适用于 Windows 的 MinGW gcj?

    我找不到 MinGW 的 gcj 二进制文件的链接 它没有出现在 MinGW get 列表中 并且我找不到二进制文件the site http www mingw org wiki Compile with gcj 它真的存在吗 我在哪里可
  • STL容器的范围插入函数在c ++ 11下返回void?

    刚刚学习c 所以我可能没有正确理解这一点 但我只读到范围插入函数在新标准下返回一个迭代器 C Primer 5th Ed cplusplus com http www cplusplus com reference string basic
  • 在Windows下使用通过MSYS2安装的cmake 3.5.2,缺少“MinGW Makefiles”生成器

    我正在尝试使用 MinGW 作为编译器 在 Windows 下进行 hello world 测试来制作 cmake 这个答案 https stackoverflow com a 4101496 4063051建议运行cmake与 G标志如下
  • windows mingw 星号 '*' 通过 argv[1] 传递给字符串

    我在下面写了一段代码 include
  • MinGW支持MFC吗?

    我已经使用 MinGW 开发了 WinAPI 应用程序 没有出现任何问题 现在 我可以用 MFC 做同样的事情吗 我只是在这里猜测 但我认为您需要购买 Visual Studio 的副本才能获得使用 MFC 的许可证 MFC 也不因其对 C
  • Qt + win32 + mingw 上的原生 Windows API 链接问题

    我正在尝试使用 mingw 工具集将本机 Windows API 与 Qt 结合使用 部分功能存在链接问题 会发生什么 这是 mingw 名称修改的错误吗 ifdef Q WS WIN HWND hwnd QWidget winId HDC
  • 使用 MinGW 链接到 Python

    我不想创建一个嵌入Python解释器的跨平台程序 并用MinGW编译它 但是 Python 二进制发行版没有提供 MinGW 链接的库 仅python32 lib对于 Visual C 并且 Python 源包不提供使用 MinGW 编译的
  • MinGW Make 抛出“系统找不到指定的路径。”错误

    我正在尝试在 Windows 7 上使用 cmake 生成一个 c 项目 在实际创建项目之前 cmake 会对您的工具链进行快速测试 我正在使用 MinGW 这就是我的问题所在 Cmake 触发 make 构建 最终失败并返回 系统找不到指
  • 编译时未定义对“WinMain@16”的引用

    我刚刚安装视觉工作室代码当出现这个问题时 我正在尝试运行我的代码 编译时未定义对 WinMain 16 的引用 我在网上搜索了相关答案 但没有找到有效的答案 这里有一个更详细的output在控制台中 cd f g testing cpp o
  • 为什么在 WebApi 上下文中在 using 块中使用 HttpClient 是错误的?

    那么 问题是为什么在 using 块中使用 HttpClient 是错误的 但在 WebApi 上下文中呢 我一直在读这篇文章不要阻止异步代码 https blog stephencleary com 2012 07 dont block
  • 使用 ssh-keygen 创建 SSH 密钥不会创建 .ssh 文件夹

    我正在尝试使用 msysgit 创建我的公共 私有 rsa 密钥对 我运行这个命令 ssh keygen C email protected cdn cgi l email protection t rsa 一切看起来都很好 我收到消息了
  • Windows 上的努伊特卡

    在 Windows 上使用 Nuitka 编译 hello world py 时遇到问题 我正在使用的命令是 nuitka standalone portable remove output recurse all python versi
  • 如何使用 mingw gcc 链接 msvcr90.dll?

    如何使用 mingw gcc 链接 msvcr90 dll 我尝试了 lmsvcr90 这是最小的示例 include
  • 在 QtCreator 中调试时如何查看 qDebug 消息

    我正在从 Eclipse CDT 带有 Qt 集成插件 过渡到 QtCreator 2 0 但仍有一件事困扰着我 QtCreator 当我在 QtCreator 中调试时 我在Application output tab直到我停止正在调试的
  • GCC C++ pow 精度

    所以我在参加一个计算竞赛时 我注意到一个奇怪的错误 pow 26 2 总是返回 675 有时返回 674 即使正确答案是 676 pow 26 3 pow 26 4 等也会出现此类错误 经过比赛后的一些调试 我相信答案与 int 向下舍入的
  • 我是否必须在 SQLConnection 被释放之前关闭它?

    根据我的其他关于一次性物品的问题 https stackoverflow com questions 1033334 is there a list of common object that implement idisposable f
  • 编写一个转储屏幕像素的 RDP 客户端

    我想在中实现 RDP 客户端C 它能够获取屏幕所有像素的颜色值并将它们转储到文件中 我知道这在概念上与 RDP 的工作方式不同 但我的应用程序需要它 我正在尝试利用freerdp https github com FreeRDP FreeR
  • C++:将模板参数的模板类型成员添加为好友的正确语法?

    我有一个带有模板类型参数 tTRAIT 的类 我想加一个模板为好友type member aliastTRAIT 但我无法弄清楚语法 这可能吗 template

随机推荐