[英]Compiling osgconv on Linux statically with support for obj files
我已經在Linux(32位)上編譯了OpenSceneGraph 3.4.0,設置了DYNAMIC_OPENSCENEGRAPH和DYNAMIC_OPENTHREADS標志為OFF,並在CMake上啟用了應用程序和示例。
構建成功,並且我有靜態庫,示例osgstaticviewer也能正常工作。
然后,我嘗試僅使用靜態庫來編譯osgconv,並使用從osgstaticviewer復制的CMakeLists.txt進行修改,並添加obj支持和osgconv原始源文件進行修改。 編譯有效且生成的可執行文件有效,但是我無法將obj文件轉換為osg文件。 特別是,如果我嘗試命令:
./osgconv myModel.obj myModel.osg
我收到以下警告:
Warning: Could not find plugin to read objects from file "myModel.obj".
Error no data loaded.
靜態鏈接osg插件的過程是什么?
在用於編譯osgconv的CMakeLists.txt下面:
#this file is automatically generated
SET(TARGET_ADDED_LIBRARIES osgdb_obj osgdb_ive osgdb_openflight osgdb_osg osgdb_rgb osgdb_osg )
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_deprecated_osg osgdb_deprecated_osgparticle osgdb_deprecated_osganimation
osgdb_deprecated_osgfx osgdb_deprecated_osgsim osgdb_deprecated_osgtext
osgdb_deprecated_osgviewer osgdb_deprecated_osgshadow osgdb_deprecated_osgterrain
osgdb_deprecated_osgvolume osgdb_deprecated_osgwidget
)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
osgdb_serializers_osg osgdb_serializers_osgparticle osgdb_serializers_osgtext
osgdb_serializers_osgterrain osgdb_serializers_osganimation osgdb_serializers_osgfx
osgdb_serializers_osgshadow osgdb_serializers_osgmanipulator osgdb_serializers_osgsim
osgdb_serializers_osgvolume
)
IF(FREETYPE_FOUND)
ADD_DEFINITIONS(-DUSE_FREETYPE)
SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} osgdb_freetype)
ENDIF(FREETYPE_FOUND)
SET(TARGET_SRC
OrientationConverter.cpp
osgconv.cpp
)
SET(TARGET_H
OrientationConverter.h
)
SETUP_APPLICATION(osgconv)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.