Skip to main content
 首页 » 编程设计

python之由于 osgProducer 链接错误,无法安装 PyOSG

2025年05月04日13lautakyan007

我正在尝试使用 pip install PyOSG 为 OSG 安装 Python 包装器。

但失败并出现此错误:

g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/Producer/Referenced.o build/temp.linux-x86_64-2.6/Producer/Camera.o build/temp.linux-x86_64-2.6/Producer/RenderSurface.o build/temp.linux-x86_64-2.6/Producer/KeyboardMouse.o build/temp.linux-x86_64-2.6/Producer/buildinfo.o build/temp.linux-x86_64-2.6/Producer/Block.o build/temp.linux-x86_64-2.6/Producer/Keyboard.o build/temp.linux-x86_64-2.6/Producer/Timer.o build/temp.linux-x86_64-2.6/Producer/VisualChooser.o build/temp.linux-x86_64-2.6/Producer/CameraConfig.o build/temp.linux-x86_64-2.6/Producer/Producer.o build/temp.linux-x86_64-2.6/Producer/CameraGroup.o build/temp.linux-x86_64-2.6/Producer/Trackball.o build/temp.linux-x86_64-2.6/Producer/Events.o build/temp.linux-x86_64-2.6/Producer/InputArea.o build/temp.linux-x86_64-2.6/Producer/Math.o -lboost_python -lOpenThreads -lProducer -lProducer -losg -losgDB -losgFX -losgGA -losgParticle -losgProducer -losgSim -losgUtil -losgText -o build/lib.linux-x86_64-2.6/PyOSG/_Producer.so 
 
/usr/bin/ld: cannot find -losgProducer 
 
collect2: ld returned 1 exit status 
 
error: command 'g++' failed with exit status 1 

我已经安装了OSG依赖的Producer,所以我不知道我还应该安装什么才能使链接成功。

请您参考如下方法:

Producer 至少已经过时几年了,取而代之的是 osgViewer 和相关类,至少早在 1.0 版之前,也可能更早。

尝试寻找更新版本的 PyOSG,或者尝试其中一个更活跃的项目,例如:

osgSWIG(包括 Python)http://code.google.com/p/osgswig/

osgboostpyton:http://code.google.com/p/osgboostpython/

祝你好运!