If you export OSG_NOTIFY_LEVEL=DEBUG_FP, OSG will display the paths it is
searching in its attempt to locate the OpenFlight plugin.
-Paul
On 3/24/2011 1:03 PM, Ed LaFave wrote:
Hi,
Sorry if this is long winded but I wanted to make sure the description of my
problem is as clear/thorough as possible.
My project uses CMake and is intended to work in both Windows 7 32 bit and
Ubuntu 10.04 64 bit. Right now the goal of the project is to simply render an
OpenFlight file using OSG 2.8.3. My first step was to build OSG 2.8.3 in both
Linux and Windows and that seemed to go off without a hitch. I put the
resulting executables, libraries, and headers into my projects Third Party
folder which looks something like this...
ThirdParty
Windows.x86.vc.9
OpenSceneGraph-2.8.3
bin
include
OpenThreads
osg
osgAnimation
...
osgWidget
lib
osgPlugins-2.8.3
Linux.x86_64.gcc4.4
OpenSceneGraph-2.8.3
bin
include
OpenThreads
osg
osgAnimation
...
osgWidget
lib
osgPlugins-2.8.3
Here is a snippet from my .cmake file which is responsible for telling CMake
where to find OSG...
Code:
if (MSVC)
math (EXPR TARGET_COMPILER_MAJOR "${MSVC_VERSION} / 100 - 6")
set (TARGET_PLATFORM
${CMAKE_SYSTEM_NAME}.${CMAKE_SYSTEM_PROCESSOR}.vc.${TARGET_COMPILER_MAJOR})
elseif (CMAKE_COMPILER_IS_GNUCXX)
set (TARGET_PLATFORM ${CMAKE_SYSTEM_NAME}.${CMAKE_SYSTEM_PROCESSOR}.gcc)
endif ()
set (THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/ThirdParty/${TARGET_PLATFORM})
set(OSG_DIR ${THIRD_PARTY_DIR}/OpenSceneGraph-2.8.3)
set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};${OSG_DIR}/include")
set(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH};${OSG_DIR}/lib")
find_package(OpenSceneGraph REQUIRED osgDB osgFX osgGA osgShadow osgSim osgText
osgUtil osgViewer osgWidget)
Here is a dumbed down version of the CMakeLists.txt my project is using to link
against OSG...
Code:
project (MyProject)
QT4_WRAP_CPP(QT_MOC_FILES ClassA.h ClassB.h)
set(HEADERS ClassA.h ClassB.h)
set(SOURCES ClassA.cpp ClassB.cpp main.cpp)
set (DEPENDENCIES ${OPENSCENEGRAPH_LIBRARIES} ${QT_LIBRARIES})
include_directories (${OSG_INCLUDE_DIR} ${QT_INCLUDE_DIR})
add_executable (${PROJECT_NAME} ${HEADERS} ${SOURCES} ${QT_MOC_FILES})
target_link_libraries(${PROJECT_NAME} ${DEPENDENCIES})
Here is my code which is trying to use OSG to load the OpenFlight file...
Code:
mNode = osgDB::readNodeFile("MyOpenFlightFile.flt");
In Windows this works perfectly, no problem at all. In Linux the OpenFlight
file is not rendered, when the readNodeFile method is called the following
output is generated...
Code:
Warning: Could not find plugin to read objects from file "MyOpenFlightFile.flt".
The first thing I did was verify that the OpenFlight plugin does in fact exist
and it was located at
ThirdParty/Linux.x86_64.gcc4.4/OpenSceneGraph-2.8.3/lib/osgPlugins-2.8.3/osgdb_openflight.so
At this point I assumed that my system simply didn't know where to look so I
added the following paths to LD_LIBRARY_PATH...
Code:
/work/MyProject/ThirdParty/Linux.x86_64.gcc4.4/OpenSceneGraph-2.8.3/lib/:/work/MyProject/ThirdParty/Linux.x86_64.gcc4.4/OpenSceneGraph-2.8.3/lib/osgPlugins-2.8.3
Now when I my code calls the osgDB::readNodeFile I crash with a Segmentation
fault (core dumped). So now I'm just left frustrated because I can't figure out
whats going wrong. Anybody know what I might be doing wrong?
...
Thank you!
Cheers,
Ed[/quote]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37867#37867
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org