Panda3d编译

本文档详细介绍了如何编译Panda3D,包括从获取依赖到执行编译步骤。在编译过程中,可能会遇到如'Error in ffmpegVirtualFile.cxx'和'size_t'语法错误的问题,通过将'int64_t'替换为'__int64',以及在openCVTexture.h中添加缺失的类型定义,可以成功解决这些问题。对于不需要Python支持的用户,可以使用 '--no-python' 参数进行编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在官网上,先有这么一段


Note that in the past, it was very difficult to build Panda3D. Things have improved. It is now fairly straightforward to download and compile panda. In particular, this is a sensible thing to do if you wish to add some functionality to panda.

To avoid possible consistency problems, the documentation for building the source is included with the source, not in the manual. Download a source package from the panda website, then look in the directory "doc," where you will find two files: INSTALL-MK and INSTALL-PP. These contain the instructions on the two different build-systems, "makepanda" and "ppremake".


While building you'll get a list of not found dependencies. Further descriptions of those can be found here: Dependencies.


这里面提供的信息是:

在源代码的根目录的doc下,有两个文件,分别是INSTALL-MK 和 INSTALL-PP。这两个文件提供了具体编译Panda3D的步骤。


特别要注意的是,在编译前,下面的链接是Panda3d的依赖表:

https://www.panda3d.org/manual/index.php/Dependencies


另外,官网上有一篇教程,说到编译这件事情:

https://www.panda3d.org/manual/index.php/Tutorial:_Compiling_the_Panda3D_Source_on_Windows


实际上,我的编译步骤(Python、VS2008、DX都装好):

1、CMD下进入源代码根目录

2、makepanda\makepanda.bata --everything


就可以看到编译了(有相关的进入可以看到)。

@ 第一次失败,出错信息:  Error in ffmpegVirtualFile.cxx near line 41, column 36 

修正方式:定位到ffmpegVirtualFile.cxx,替换所有的int64_t到__int64就可以。


然后整个就可以编译过了。


如果不需要python,那么可以用 --no-python参数。

@ 会失败,出错信息:[ 35%] Building C++ object built/tmp/vision_composite1.obj vision_composite1.cxx d:\panda3d-1.7.2_no_python\panda\src\vision\openCVTexture.h(89) : error C2061: syntax error : identifier 'ssize_t' 

修正方式:定位到openCVTexture.h,在#ifdef HAVE_OPENCV下面,加入

#ifndef HAVE_SSIZE_T 
#ifdef MS_WIN64 
typedef __int64 ssize_t; 
#else 
typedef _W64 int ssize_t; 
#endif 
#define HAVE_SSIZE_T 1 
#endif 

然后整个没有python的就编译成功了。



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值