World Wind .NET源码编译问题处理

World  Wind  .NET源码编译问题处理

下载了World_Wind_1.4.0_Source源码(http://worldwindcentral.com/wiki/NASA_World_Wind_Download),打开后发现问题真不少,只能一个个排查了:

一、错误 1 未能找到类型或命名空间名称“Org”(是否缺少 using 指令或程序集引用?) \WorldWind\World_Wind_1.4.0_Source\WorldWind\GpsPlugin\GPSTrackerPlugin.UDPTCP.cs 28 7 WorldWind

解决办法:假定所有的源文件的根目录为World_Wind_1.4.0_Source,在该目录下,找到World_Wind_1.4.0_Source\bin\Debug,将该目录下的Config、Data和Plugins目录,以及AviFile.dll、FlickrNet.dll、Org.Mentalis.Security.dll、ZedGraph.dll等拷贝粘贴到World_Wind_1.4.0_Source\WorldWind\bin\x86\Release目录下即可。

从World Wind的官网下载了程序包,是发现了一堆的问题。

二、字符文本中的字符太多

看信息详情

开始以“使用简体中文(GB2312)编码加载的文件”,说相应的解决办法如此链接:http://mituhao.diandian.com/post/2012-01-05/40027609137 说要勾选 工具|选项和设置|文本编辑器|自动检测不带签名的UTF8编码.但是自己检查看了下,已经是勾选的,很显然不是这个问题。实际上这个问题主要是ConfigurationLoader.cs和Angle.cs有错误。看后去官网https://nasa-exp.svn.sourceforge.net/svnroot/nasa-exp/trunk/WorldWind/看了下网页版的代码。修改相应的部分就可以了。

具体修改入如下:

  Angle.cs  

复制代码
复制代码
 1     /// <summary>
 2         /// Converts degrees to degrees/minutes/seconds
 3         /// </summary>
 4         /// <returns>String on format dd癿m'ss.sss"</returns>
 5         public string ToStringDms()
 6         {
 7             double decimalDegrees = this.Degrees;
 8             double d = Math.Abs(decimalDegrees);
 9             double m = (60*(d-Math.Floor(d)));
10             double s = (60*(m-Math.Floor(m)));
11 
12             return String.Format("{0}皗1}'{2:f3}\"", 
13                 (int)d*Math.Sign(decimalDegrees), 
14                 (int)m, 
15                 s);
16         }
17 
18         public override string ToString()
19         {
20             return Degrees.ToString(CultureInfo.InvariantCulture)+"?;
21         }
复制代码
复制代码

  修改为:

  

复制代码
复制代码
 1         /// <summary>
 2         /// Converts degrees to degrees/minutes/seconds
 3         /// </summary>
 4         /// <returns>String on format dd°m'ss.sss"</returns>
 5         public string ToStringDms()
 6         {
 7             double decimalDegrees = this.Degrees;
 8             double d = Math.Abs(decimalDegrees);
 9             double m = (60*(d-Math.Floor(d)));
10             double s = (60*(m-Math.Floor(m)));
11 
12             return String.Format("\"{0}°{1}'{2:f3}\"", 
13                 (int)d*Math.Sign(decimalDegrees), 
14                 (int)m, 
15                 s);
16         }
17 
18         public override string ToString()
19         {
20             return Degrees.ToString(CultureInfo.InvariantCulture)+"?";
21         }
复制代码
复制代码

  ConfigurationLoader.cs  

1   string viewBBox = string.Format(CultureInfo.InvariantCulture,
2          "{0},{1},{2},{3}",
3          bbox[0].ToString().TrimEnd('?), bbox[1].ToString().TrimEnd('?), bbox[2].ToString().TrimEnd('?), bbox[3].ToString().TrimEnd('?));

  修改为:

1   string viewBBox = string.Format(CultureInfo.InvariantCulture, 
2         "{0},{1},{2},{3}",
3         bbox[0].ToString().TrimEnd('?'),bbox[1].ToString().TrimEnd('?'), bbox[2].ToString().TrimEnd('?'),bbox[3].ToString().TrimEnd('?'));

 

问题三:无法注册程序集“..\Debug\HtmlEditor.dll”- 拒绝访问。请确保您正在以管理员身份运行应用程序。对注册表项“HKEY_CLASSES_ROOT\CLSID\{25336920-03F9-11CF-8FD0-00AA00686F13}”的访问被拒绝

解决办法右键HtmlEditor属性 生成|为COM互操作注册 前面的勾去掉。

 

问题四、缺少程序集引用问题

错误1:      丢失引用问题

    

  原因:无法找到引用的DLL文件   

     解决方法:   1.更改发布模式为调试模式(最简单,不用重新添加引用)   2.将Debug文件下所有文件复制到World_Wind_1.4.0_Source\WorldWind\bin\x86\Release目录下   参看:       http://bbs.godeyes.cn/showtopic-324487.aspx   假定所有的源文件的根目录为World_Wind_1.4.0_Source,在该目录下,找到World_Wind_1.4.0_Source\bin\Debug,将该目录下的Config、Data和Plugins目录,以及AviFile.dll、FlickrNet.dll、Org.Mentalis.Security.dll、ZedGraph.dll等拷贝粘贴到World_Wind_1.4.0_Source\WorldWind\bin\x86\Release目录下即可。

 问题五、非托管代码LoaderLock问题 

     

LoaderLock问题

  解决方法:   ctrl+D+E或alt+ctl+e或使用菜单(调试-》异常)——》异常窗口 ——》ManagerDebuggingAssistants ——》去  掉LoaderLock选项

问题六、64位环境编译错误问题

解决方法:

 

七、DirectX问题

  编译运行之前首先要安装DirectX,因为Worl Wind中的子项目有对其的引用,如下:

  PluginSDK项目需三个引用:Microsoft.DirectX,Microsoft.DirectX.Direct3D,Microsoft.DirectX.Direct3DX;   WorldWind项目需四个引用:Microsoft.DirectX,Microsoft.DirectX.Direct3D,Microsoft.DirectX.Direct3DX,Microsoft.DirectX.DirectInput。  DirectX是微软一系列技术地集成,用来提供Windows平台多媒体运行地API,支持应用程序、多媒体软件和3D游戏非常声效。

  我下载地是DirectX11。

 

OK,问题解决了,一起来享受下美丽的地球吧!

 

posted @ 2014-01-03 14:06  小宝马的爸爸-gisera  阅读(618)  评论(0编辑  收藏  举报