麟の随笔

  • 游戏
  • 影视
  • Tech
  1. 首页
  2. 科技
  3. C
  4. 正文

Windows平台下编译OpenCPN 5.10.X开发版本

2024年9月9日 1353点热度 0人点赞 0条评论

一、环境配置

1、安装Git环境

前往 https://git-scm.com/ 下载并按照默认安装

2、安装choco软件

方法一:前往 https://chocolatey.org/install 下载
方法二:

  1. 以管理员权限打开Windows PowerShell。
  2. 在打开的“Windows PowerShell”中输入如下命令:
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

    file
    然后回车,就会自动下载并安装。
    file
    3.安装后在Windows PowerShell中输入:choco
    显示版本号,则安装成功。
    file
    4.安装图形化界面(非必须),代码如下:

    choco install chocolateygui

    file
    安装之后输入 chocolateygui 打开图形界面(或在开始菜单中打开Chocolatey Gui 软件),选择左侧菜单中的chocolatey,安装你想安装的软件即可。
    file

    3、安装 Visual Studio 2022 Community Edition

    前往 https://visualstudio.microsoft.com/vs/community/
    若已经安装,但是没有在开始菜单中找到x86 Native Tools Command Prompt for VS 2022 (or 2019),则需要安装对应组件
    1、从开始菜单中搜索Visual Studio Installer
    file
    2、打开后选择修改
    file
    3、找到使用C++的桌面开发选项并勾选,点击右下角的修改
    file
    4、等待安装完成
    file

    二、使用Visual Studio 2022 进行编译

    1、克隆项目

    git clone https://github.com/opencpn/opencpn

    file

    2、编译项目

    打开x86 Native Tools Command Prompt for VS 2022 (or 2019)
    file
    进入到目录后执行

    .\buildwin\winConfig.bat

    file
    正常会发生编译错误
    file
    若出现此类错误,打开\opencpn\gui\src\options.cpp,查找zh_TW,将正體字修改为英文
    file
    再次执行,等待出现如下提示代表编译成功
    file
    此时,通过.\build\opencpn.sln来打开工程。若要直接使用文件打开,需要执行D:\project\opencpn\buildwin\configdev.bat再打开

    运行项目

    1、通过打开后的界面,点击上方的本地Windows调试器运行
    file
    2、弹出以下界面即可代表运行成功,点击取消,打开主程序
    file
    3、欢迎页
    file
    4、成功运行OpenCPN
    file

标签: 暂无
最后更新:2024年9月9日

晓虎

必须有人浴血奋战,世上才有自由可言!

点赞
< 上一篇

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

文章目录
  • 一、环境配置
    • 1、安装Git环境
    • 2、安装choco软件
    • 3、安装 Visual Studio 2022 Community Edition
  • 二、使用Visual Studio 2022 进行编译
    • 1、克隆项目
    • 2、编译项目
  • 运行项目

COPYRIGHT © 2024 kirinz.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

闽ICP备19013981号