`
isiqi
  • 浏览: 16356278 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

怎样在Windows下编译OpenVRML

阅读更多

参考原文:https://sourceforge.net/apps/trac/openvrml/wiki/BuildOpenvrmlOnWindows

Original version copyright (C) Zack Smith 2008

今天花了一整天的时候配置编译环境并编译,尽管仍未编译成功,但已将错误减少至两处,而且这剩下的两处也应该是我对VC不了解而出现的,希望能很快解决。 注:build在文中被译作构建,可能有点别扭。。。

1. 获取OpenVRML

http://openvrml.org/download 获取OpenVRML 分发 (发行包或Subversion处最新源码) 。

2. 下载Visual C++ Express

如果你还没有微软的编译器,你可以使用免费版 Visual C++ Express

3. 安装预编译的 Boost C++ 库

BoostPro Computing freely available installer 来构建Windows下的Boost。

至少要为最新版本的Microsoft Visual C++ 编译器(当前为9.0)安装"Multithread" 和 "Multithread Debug"变体的库。注:这个工具可以根据需要下载源文件和预编译的库文件,根据后面编译的情况来看,应该还要选date_time、system、thread等。

The installers for versions 1.37.0 and 1.38.0 appear to have a glitch such that checking the boxes to install the variants globally for all libraries may not actually result in that selection propagating to the individual libraries. Make sure that you expand the tree of available variants to install and specifically check the "Multithread" and "Multithread Debug" variants.

4. 打开解决方案文件

Visual C++ 9.0 的解决方案文件可以在OpenVRML的如下目录找到

ide-projects\Windows\VisualC9_0\OpenVRML\OpenVRML.sln

5. 将Boost头文件和库目录添加到编译器的路径列表

OpenVRML 依赖于很多库 - 每一个都要单独下载,并且必须要将它们的include和library目录添加到Visual C++路径列表中。下面的步骤阐明了如何添加到路径列表。

  1. 选择工具 -> 选项下拉菜单
  2. 在"项目和解决方案"中,选择"VC++目录",然后"包含文件"
  3. 点击文件夹图标,添加带版本号的boost目录到路径中。它应该类似于这样:
    C:\Program Files\boost\boost_1_38_0
    vc_boost.jpg
  4. 现在再选择"库文件"
  5. vc_boost_lib.jpg
  6. 点击文件夹图标添加路径,看起来应该像这样:
    C:\Program Files\boost\boost_1_38_0\lib
    

6. 构建 FreeType

  1. 下载zip文件格式的FreeType分发,从 the FreeType SourceForge project's file releases
  2. 在Visual C++中打开解决方案文件。可以在FreeType的builds\win32\vc2008 目录下找到。
  3. 选择freetype项目中的"LIB Release Multithreaded" 与 "LIB Debug Multithreaded"配置进行构建。
  4. FreeType解决方案会输出所有的库到同样的目录下,objs\win32\vc2008 .(提一下,个别的路径可能根据所用的编译版本而有所不同) 。将该目录添加到VS的库目录下。形式如下:
    C:\Users\Joe\freetype-2.3.9\objs\win32\vc2008
    
  5. 将FreeType的include子目录添加到VS的包含文件目录。形式如下:
    C:\Users\Joe\freetype-2.3.9\include
    

7. 构建 libpng

  1. libpng SourceForge project's file releases 下载最新版本的libpng及zlib分发的zip文件。
  2. 解压libpng后,将zlib的内容解压到与libpng同一级目录下的"zlib"文件夹。利润,如果你的libpng放在C:\Users\Joe\lpng1235 ,你的zlib就应该放在C:\Users\Joe\zlib 。注意尽管libpng的zip文件包含了顶级目录,但zlib到目前1.2.3版本为止未包括。
  3. 在Visual C++中打开libpng解决方案文件。可以在libpng的projects\visualc71\libpng.sln 找到。
  4. 按照 libpng 项目的"LIB Debug" 和 "LIB Release"配置进行构建。zlib会自动作为依赖被构建。
  5. 将libpng的输出目录添加到Visual C++的库目录列表。形式如下:
    C:\Users\Joe\lpng1235\projects\visualc71\Win32_LIB_Debug
    C:\Users\Joe\lpng1235\projects\visualc71\Win32_LIB_Release
    
  6. 将zlib和libpng的源码目录添加到Visual C++的包含文件目录。形式如下:
    C:\Users\Joe\zlib
    C:\Users\Joe\lpng1235
    

8. 获取 SpiderMonkey (Mozilla JavaScript 运行时环境)

最简单的是从Mozilla下载预编译形式的代码XULRunner:ftp://ftp.mozilla.org/pub/xulrunner/releases/

获取SDK版本,提取出来。将的lib目录添加到Visual C++的库文件目录列表。形式如下:

C:\Users\Joe\xulrunner-sdk\lib

将的 SpiderMonkey? include目录添加到Visual C++的包含文件目录列表。形式如下:

C:\Users\Joe\xulrunner-sdk\include\js

9. 安装 SDL

你有两个选择:下载预编译的DLL文件加上include文件,或者自己来构建 。预编译的可以去http://www.libsdl.org/download-1.2.php 下载。所包含的DLL文件将会被放到OpenVRML的二进制目录。

10. 将SDL的头文件和库目录添加到VC++路径列表

注:直接用DLL文件似乎不行,它调用的静态链接文件,需要下载源码编译为lib文件。

11. 在调试器中运行 sdl-viewer

我们需要添加一个命令行参数来浏览文件,如为了测试可执行文件。右键单击sdl-viewer项目,点击属性,调试,命令参数。添加内容类似如下:

file:///c:/users/YOURNAME/desktop/openvrml/models/snoman.wrl

12. 构建解决方案

生成的唯一可执行文件为 sdl-viewer.exe。

13. 设置环境变量

将openvrml/data目录的完整路径设置到环境变量 OPENVRML_DATA。在Vista下形式如:

c:/users/YOURNAME/desktop/openvrml/data

或在XP下:

c:/docume~1/YOURNAME/desktop/openvrml/data

14. 将sdl-viewer设置为缺省的应用程序来进行调试

在sdl-viewer项目上右键单击,然后选择"设置为启动项目"

15. 运行脚本

如果你希望运行带有Javascript的VRML/X3D文件,你需要做两件事:首先,设置OPENVRML_SCRIPT_PATH 环境变量;然后,复制 JSAPI's js2350.dll 与 nspr4.dll 到OpenVRML的二进制目录。

16. 按F5在调试模式下运行程序


问题解决

  • If you get an error during the loading of DLLs, and the error code is hexadecimal, such as:
    The application failed to initialize property (0xE06D7363)
    
    this may indicate that your OPENVRML_DATADIR environment variable is unset or incorrectly set. In an ideal world, this problem would result in a MessageBox() call; but presently it doesn't.
  • To do a proper "clean solution", you may not want to rely on VC++. It's not as deterministic as make under Unix. Use Cygwin carefully thus:
    rm `find . -name "*.obj"`
    rm `find . -name "*.lib"`
    rm `find . -name "*.dll"`
    rm `find . -name "*.exe"`
    
    Don't forget the "-name" part! Forgetting it will remove everything.
  • If there is a problem with manifest files not being produced, note that VC++ normally produces them itself. To repair a manifest file problem, you may need to do a proper clean (above). It may help if you have /NODEFAULTLIB:MSVCRT.LIB in your linker command-line arguments for all projects.

下面贴出错误代码,有高手请指点一下:

1>正在链接...
1> 正在创建库 E:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\Release\lib\openvrml.lib 和对象 E:\X3D\Soft\openvrml-0.18.3\ide-

projects\Windows\VisualC9_0\OpenVRML\Release\lib\openvrml.exp
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "struct HINSTANCE__ *

__cdecl openvrml::local::dl::open(class std::basic_string<char,struct

std::char_traits<char>,class std::allocator<char> > const &)" (?

open@dl@local@openvrml@@YAPAUHINSTANCE__@@ABV?$basic_string@DU?$char_traits@D@std@@V?

$allocator@D@2@@std@@@Z)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "void * __cdecl

openvrml::local::dl::sym(struct HINSTANCE__ *,class std::basic_string<char,struct

std::char_traits<char>,class std::allocator<char> > const &)" (?

sym@dl@local@openvrml@@YAPAXPAUHINSTANCE__@@ABV?$basic_string@DU?$char_traits@D@std@@V?

$allocator@D@2@@std@@@Z)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "int __cdecl

openvrml::local::dl::foreachfile(class std::vector<class boost::filesystem::basic_path<class

std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct

boost::filesystem::path_traits>,class std::allocator<class

boost::filesystem::basic_path<class std::basic_string<char,struct

std::char_traits<char>,class std::allocator<char> >,struct boost::filesystem::path_traits> >

> const &,int (__cdecl*)(class std::basic_string<char,struct std::char_traits<char>,class

std::allocator<char> > const &,void *),void *)" (?foreachfile@dl@local@openvrml@@YAHABV?

$vector@V?$basic_path@V?$basic_string@DU?$char_traits@D@std@@V?

$allocator@D@2@@std@@Upath_traits@filesystem@boost@@@filesystem@boost@@V?$allocator@V?

$basic_path@V?$basic_string@DU?$char_traits@D@std@@V?

$allocator@D@2@@std@@Upath_traits@filesystem@boost@@@filesystem@boost@@@std@@@std@@P6AHABV?

$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@5@PAX@Z2@Z)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "int __cdecl

openvrml::local::dl::close(struct HINSTANCE__ *)" (?

close@dl@local@openvrml@@YAHPAUHINSTANCE__@@@Z)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "class

std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const

__cdecl openvrml::local::dl::error(void)" (?error@dl@local@openvrml@@YA?BV?

$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "int __cdecl

openvrml::local::dl::init(void)" (?init@dl@local@openvrml@@YAHXZ)
1>node_metatype_registry_impl.obj : error LNK2001: 无法解析的外部符号 "int __cdecl

openvrml::local::dl::exit(void)" (?exit@dl@local@openvrml@@YAHXZ)
1>E:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\Release\bin\openvrml.dll : fatal error LNK1120: 7 个无法解析的外部命令
1>生成日志保存在"file://e:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\openvrml\Release\BuildLog.htm"
1>openvrml - 8 个错误,2 个警告

14>LINK : fatal error LNK1104: 无法打开文件"LIBC.lib"
14>生成日志保存在"file://e:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\vrml97\Release\BuildLog.htm"
14>vrml97 - 1 个错误,1 个警告

19>正在链接...
19> 正在创建库 E:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\Release\bin\sdl-viewer.lib 和对象 E:\X3D\Soft\openvrml-0.18.3\ide-

projects\Windows\VisualC9_0\OpenVRML\Release\bin\sdl-viewer.exp
19>SDL.lib(SDL_systimer.obj) : error LNK2001: 无法解析的外部符号 __imp__timeGetTime@0
19>SDL.lib(SDL_systimer.obj) : error LNK2001: 无法解析的外部符号 __imp__timeBeginPeriod@4
19>SDL.lib(SDL_systimer.obj) : error LNK2001: 无法解析的外部符号 __imp__timeSetEvent@20
19>SDL.lib(SDL_systimer.obj) : error LNK2001: 无法解析的外部符号 __imp__timeEndPeriod@4
19>SDL.lib(SDL_systimer.obj) : error LNK2001: 无法解析的外部符号 __imp__timeKillEvent@4
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_POV
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_Slider
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_RzAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_RyAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_RxAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_ZAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_YAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_XAxis
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _GUID_Key
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _IID_IDirectDrawSurface3
19>SDL.lib(SDL_dx5yuv.obj) : error LNK2001: 无法解析的外部符号 _IID_IDirectDrawSurface3
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号 _IID_IDirectDraw2
19>SDL.lib(SDL_dx5video.obj) : error LNK2001: 无法解析的外部符号

_IID_IDirectDrawGammaControl
19>SDL.lib(SDL_syscdrom.obj) : error LNK2001: 无法解析的外部符号

__imp__mciGetErrorStringA@12
19>SDL.lib(SDL_syscdrom.obj) : error LNK2001: 无法解析的外部符号 __imp__mciSendCommandA@16
19>SDL.lib(SDL_mmjoystick.obj) : error LNK2001: 无法解析的外部符号 __imp__joyGetDevCapsA@12
19>SDL.lib(SDL_mmjoystick.obj) : error LNK2001: 无法解析的外部符号 __imp__joyGetPosEx@8
19>SDL.lib(SDL_mmjoystick.obj) : error LNK2001: 无法解析的外部符号 __imp__joyGetNumDevs@0
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号 __imp__waveOutWrite@12
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号

__imp__waveOutUnprepareHeader@12
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号 __imp__waveOutClose@4
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号

__imp__waveOutPrepareHeader@12
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号 __imp__waveOutOpen@24
19>SDL.lib(SDL_dibaudio.obj) : error LNK2001: 无法解析的外部符号

__imp__waveOutGetErrorTextA@12
19>SDL.lib(SDL_dx5events.obj) : error LNK2001: 无法解析的外部符号 _GUID_SysMouse
19>SDL.lib(SDL_dx5events.obj) : error LNK2001: 无法解析的外部符号 _GUID_SysKeyboard
19>SDL.lib(SDL_dx5events.obj) : error LNK2001: 无法解析的外部符号 _IID_IDirectInputDevice2A
19>E:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0\OpenVRML\Release\bin\sdl-

viewer.exe : fatal error LNK1120: 31 个无法解析的外部命令
19>生成日志保存在"file://e:\X3D\Soft\openvrml-0.18.3\ide-projects\Windows\VisualC9_0

\OpenVRML\sdl-viewer\Release\BuildLog.htm"
19>sdl-viewer - 33 个错误,0 个警告

Powered by Zoundry Raven

分享到:
评论

相关推荐

    在windows下编译brave浏览器

    ### 在Windows下编译Brave浏览器的关键步骤及注意事项 #### 一、概述 本文旨在详细介绍如何在Windows操作系统下成功编译Brave浏览器的过程。Brave是一款开源浏览器,以其隐私保护特性而闻名。对于想要深入了解其...

    windows下编译u-boot代码

    ### 在Windows环境下使用MSYS与MinGW编译U-Boot代码 #### 一、搭建MSYS与MinGW环境 在Windows环境下编译U-Boot,首先需要安装MSYS与MinGW来提供必要的编译工具链。 **1. MSYS与MinGW** - **MSYS**(Minimal ...

    ucos在windows下编译运行

    标题 "ucos在windows下编译运行" 描述了如何在Windows操作系统环境下,利用Visual Studio 2010(VS2010)对实时操作系统(RTOS)uC/OS-II进行编译和运行。这个过程涉及到嵌入式系统开发、操作系统移植、编译工具链的...

    windows下编译postgresql源码编译环境搭建

    在Windows环境下编译PostgreSQL源码是一项技术性较强的任务,涉及到多个步骤和工具。PostgreSQL是一种开源的关系型数据库管理系统,其源代码可以在多种操作系统上编译,包括Windows。以下是详细的编译过程和所需环境...

    windows下编译adb源码

    首先,要进行Windows下的ADB源码编译,你需要准备以下几项基本工具: 1. **Visual Studio 2010**:由于描述中提到使用VS2010进行编译,因此确保你已经安装了这个版本的开发环境,包括C++编译器和必要的构建工具。 ...

    windows下编译libiconv-1.15

    windows下编译libiconv-1.15 '

    windows下编译的botan动态库

    标题提到的"windows下编译的botan动态库"指的是在Windows操作系统上编译的Botan库的动态链接库(DLL)版本。动态链接库是一种共享库,程序运行时才加载到内存,降低了程序的启动时间和内存占用。 在Windows环境下,...

    windows下编译FreeRDP.zip

    在Windows环境下编译FreeRDP是一项对初学者来说可能颇具挑战性的任务,因为涉及到许多步骤和技术细节。FreeRDP是一个开源的远程桌面协议(RDP)客户端,它允许用户通过命令行或其他应用程序接口与远程Windows系统进行...

    windows下编译php­beast扩展

    在Windows环境下编译PHP-beast扩展是一个较为复杂的过程,涉及到选择合适的编译器、设置编译环境、准备编译文件、以及执行具体的编译步骤。本文将详细说明如何在Windows系统中编译PHP-beast扩展,同时会提供必要的...

    Windows下编译Qt

    ### Windows下编译Qt知识点详解 #### 一、编译环境搭建 在Windows环境下编译Qt,首先需要准备相应的开发工具及环境。 1. **安装必要的软件:** - **Visual Studio:** Qt支持多种版本的Visual Studio进行编译,...

    windows下编译pcre库的工程

    在Windows环境下,编译PCRE库(Perl Compatible Regular Expressions)是一项常见的任务,尤其是在开发C或C++项目时,如果需要使用正则表达式功能,PCRE库是一个强大的选择。本教程将详细介绍如何使用Visual Studio ...

    iperf3_v3.11 for windows 最新编译

    这个"iperf3_v3.11 for windows 最新编译"版本是专为Windows操作系统设计的,确保用户能够在Windows环境下进行网络性能测试。 iperf3的主要功能包括: 1. **多协议支持**:iperf3不仅支持传统的TCP协议,还支持UDP...

    redis++使用说明,windows下编译redis-plus-plus

    "Redis++使用说明,windows下编译Redis-Plus-Plus" 在这篇文章中,我们将详细介绍如何在Windows平台下编译Redis++,包括编译hiredis.lib和Win32_Interop.lib静态库文件的过程,然后安装Cmake并编译Redis++,最后...

    MySQL代码如何在Windows环境下编译

    本文介绍了如何在Windows环境下编译MySQL代码,或许有些人觉得从Windows平台编译MySQL的代码有些复杂,其实不然。本文中所提到的东西没有任何的创新性,只是对MySQL已有文档的总结。

    Windows环境下编译Opencpn

    在Windows环境下编译OpenCPN涉及到一系列的技术和工具,下面详细说明各个环节的知识点。 1. 获取OpenCPN源码: - 使用git clone命令可以获取OpenCPN的源码。通过指定一个分支(如beta31_stable)可以获取特定版本...

    windows下完全编译的openSSL,源码和lib

    在Windows环境下编译OpenSSL源码,可以让你针对特定的系统配置定制化OpenSSL库,以满足特定的需求,例如优化性能或者增加对某些特性的支持。 在Windows上编译OpenSSL,首先你需要下载OpenSSL的源码。源码包含了所有...

    windows环境编译的coturn

    coturn是比较常用turnserver,linux下编译很方便,在windows下可以使用Cygwin进行编译,附件中是编译的64位的turnserver,可以同时作为stunserver 和turnserver使用。 编译机器系统:Windows 10 64位

    windows编译的mosquitto(mqtt)

    【mosquitto与MQTT简介】 mosquitto是一款开源的MQTT消息...总之,mosquitto在Windows上的编译和使用为开发者提供了一种方便的方式来构建基于MQTT协议的应用,尤其是在物联网场景下,能够轻松实现设备间的高效通信。

Global site tag (gtag.js) - Google Analytics