Hi,

it seems like it found the headers and is breaking on linking.

I attach a CMakeLists.txt I use for simple test apps. It assumes OSG is installed and the linker can find it (e.g. mine is installed in /usr/local and /usr/local/lib is added in /etc/ld.so.conf).

You could also have a look at FindOSG module in the latest cmake versions.

jp

--8<---
PROJECT(test)

#SET(CMAKE_CXX_COMPILER "g++-3.4")

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")

SET(SOURCES
        test.cpp
)

INCLUDE_DIRECTORIES(/usr/local/include)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR})

ADD_EXECUTABLE(test ${SOURCES})

TARGET_LINK_LIBRARIES(test m osg osgUtil osgGA osgDB osgText osgSim osgParticle OpenThreads rt)

Thomas Maier wrote:
Hi,

i used the source code on this site 
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicGeometry,
 then i build test-src/ and test-build/ directories. Into test-src/ dir i put 
in the file main.cpp with the example code. Then i created a CMakeLists.txt 
file and put into it:
PROJECT(testProject)
 ADD_EXECUTABLE(testProjectMain
   main.cpp
 )

then i switched into test-build/ dir and run "ccmake ../test-src/" then i run 
"make" and the output is:
Linking CXX executable /tmp/testProjectMain
/usr/bin/cmake -E cmake_link_script CMakeFiles/testProjectMain.dir/link.txt 
--verbose=1
/usr/bin/c++ -g CMakeFiles/testProjectMain.dir/main.o -o /tmp/testProjectMain -rdynamic CMakeFiles/testProjectMain.dir/main.o: In function `main':
/home/bob/openscenegraph-programming/test/test-src/main.cpp:27: undefined 
reference to `osgViewer::Viewer::Viewer()'
/home/bob/openscenegraph-programming/test/test-src/main.cpp:28: undefined 
reference to `osg::Group::Group()'


How can i let cmake know that it should use osg header/libs? Is there anywhere 
online a tutorial which explains the building of e.g. the examples? i did not 
find anything,sorry.

thanks for help
flo




Thank you!

Cheers,
inflo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18735#18735





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to