采用 Visual Studio 编译 Mission Planner 方法与问题总结

来源:互联网 发布:web在线考试系统源码 编辑:程序博客网 时间:2024/05/22 15:00


 

如何编译Mission Planner 呢?

       我的步骤是:

       1、使用GitHub 下载 Mission Planner 源码。

       2、观察代码解决方案 ArdupilotMega.sln ,用记事本打开,确定是 Visual Studio版本。我下载的源码是2013版本。

       3、下载并安装 Visual Studio 2013

       4、用VS 打开Mission Planner 工程(ArdupilotMega.sln)。

 

       现在来一个首次编译——,你会发现有100多个错误。

        不要害怕,其实,我们还有很多设置需要去处理。

 

第一步:我们可能会看到OpenTK 相关的错误

       源码中,实际上已经有OpenTK工程了,在解决方案中,在 MissionPlanner\ExtLibs\GLControl 文件夹中,将他添加进来,就可以了。

       值得注意的是,我们编译之前,要确认所有的LIB库都已经包含到VS工程中来,列举如下:

       AviFile

       BaseClasses

       BSE.Windows.Forms

       Core

       CsAssortedWidgets

       GMap.Net.Core

       GMap.Net.WindowsForms

       KMLib

       MetaDataExtractor

       OpenTK.GLControl

       SharpKml

       UPdater

       wix

       ZedGraph

       等等,具体见下图。

采用 <wbr>Visual <wbr>Studio <wbr>编译 <wbr>Mission <wbr>Planner <wbr>方法与问题总结

 

第二步:在电脑上安装一个最新的Mission Planner。(一个直接可以打开使用的MissionPlanner)

       我的Mission Planner安装在C:\Program Files\Mission Planner。尽量确保安装的Mission Planner和你下的源码都是最新的,版本能够匹配得上。

       官方参考:Before you attempt to build (compile) Mission Planner you must also have an installed version on your PC.  That is where some of the files you will need to reference are located.  This is because these files (.dll files, Etc.) are not included in the Git repository.  Install MP the normal way or if installed, be sure you have the latest revision. The installed revision must match the download you just did.

       官方:http://dev.ardupilot.com/wiki/buildin-mission-planner/

 

第三步:做一些必要的设置,来减少错误。

       这些设置如下:

       1、打开VS Solution Explorer 解决方案资源管理器,右键点击 Mission Planner工程(注意前面有C#图标的工程,不是整个解决方案),点击【属性】、选择【引用路径】、将已经安装的Mission Planner路径填进去,点击添加文件夹。我的是:C:\Program Files\Mission Planner。见下图

采用 <wbr>Visual <wbr>Studio <wbr>编译 <wbr>Mission <wbr>Planner <wbr>方法与问题总结

       2、点击上图中的【生成事件】,移除所有“预先生成事件命令行“和”后期生成事件命令行“的内容。

       3、点击上图中的【生成】,将配置改为”Active(Debug)”。

       4、按照这个方法,继续将其他工程,都一一进行设置。最后进行编译,错误会少很多了。

 

第四步:可能还会存在这样的错误:未能找到类型或命名空间名称 log4net  是否缺少 using指令 或程序集引用。

采用 <wbr>Visual <wbr>Studio <wbr>编译 <wbr>Mission <wbr>Planner <wbr>方法与问题总结

       实际上相关的工程都已经添加了log4net的引用,为什么还报错。我查看了log4net的版本是 .net framework 4.0的。而工程用到仍然是3.5,甚至2.0版本。于是,都改成了4.0,如下图所示。

 采用 <wbr>Visual <wbr>Studio <wbr>编译 <wbr>Mission <wbr>Planner <wbr>方法与问题总结

       OK,再编译。所有问题都没有了。

       运行界面如下:

采用 <wbr>Visual <wbr>Studio <wbr>编译 <wbr>Mission <wbr>Planner <wbr>方法与问题总结

 

Building Mission Planner with Visual Studio

原创粉丝点击