Rendering using OpenSG
I have a bit of a situation here. I am trying to work with OpenSG. I downloaded the package and installed it as it was instructed in the INSTALL file. Then i installed its system dependent libraries as well. Now i tried to build its tutorial and it shows errors. It says glut is not configured but i enabled the glut library while i configured it and have installed all the dependent packages and libraries as well. I dont understand what the issue is. The errors shown while trying to make OpenSG tutorial is as follows:
ani@anilap:~/OpenSG/Tutorials$ make
g++ Warning GLUT not configured, ignoring request -D_GNU_SOURCE -DQT_CLEAN_NAMESPACE -D_OSG_HAVE_CONFIGURED_H_ -DQT_NO_XINERAMA -DQT_NO_XRENDER -DQT_NO_XFTFREETYPE -DQT_NO_XKB - DQT_NO_SM_SUPPORT -DQT_NO_IMAGEIO_MNG -DQT_NO_IMAGEIO_JPEG -DQT_NO_STYLE_AQUA - DQT_NO_STYLE_MAC -DQT_NO_STYLE_INTERLACE -DQT_NO_STYLE_COMPACT -ansi -use_readonly_const -ftemplate-depth-100 -g -DOSG_DEBUG -I/usr/local/include 01hello.cpp Warning GLUT not configured, ignoring request -g -L/usr/local/lib/dbg -lOSGWindowX -lOSGSystem -lOSGBase - lGLU -lGL -lXmu -lXi -lXt -lX11 -lpthread -ldl -lm -L/usr/X11R6/lib -o 01hello
g++: Warning: No such file or directory
g++: GLUT: No such file or directory
g++: not: No such file or directory
g++: configured,: No such file or directory
g++: ignoring: No such file or directory
g++: request: No such file or directory
g++: Warning: No such file or directory
g++: GLUT: No such file or directory
g++: not: No such file or directory
g++: configured,: No such file or directory
g++: ignoring: No such file or directory
g++: request: No such file or directory
In file included from /usr/include/c++/4.4/ext/hash_map:60,
from /usr/local/include/OpenSG/OSGWindow.h:53,
from /usr/local/include/OpenSG/OSGGeometry.h:48,
from /usr/local/include/OpenSG/OSGSimpleGeometry.h:49,
from 01hello.cpp:19:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
01hello.cpp: In function ‘int main(int, char**)’:
01hello.cpp:48: error: ‘GLUTWindowPtr’ was not declared in this scope
01hello.cpp:48: error: expected ‘;’ before ‘gwin’
01hello.cpp:49: error: ‘gwin’ was not declared in this scope
make: *** [01hello] Error 1
ani@anilap:~/OpenSG/Tutorials$
If anyone could help me find a solution to this I would be really grateful.
The makefile for the tutorial is as follows:
# trivial makefile for OpenSG tutorials
# use debug or opt libs?
LIBTYPE ?= dbg
# set the path to the installed osg-config executable here
# if you don't set it, the makefile tries to guess
# e.g. if you installed in /usr/local:
# OSGCONFIG := /usr/local/bin/osg-config
# *****************************************************
# you shouldn't have to change anything after this line
# *****************************************************
# try to guess the OSGCONFIG path
OSGCONFIG := notset
# use OSGPOOL if set
OSGPOOL ?= ..
# try to get configured information first, will not work if more
# than one system is configured from one dir. Just for the 1.0
OSGINSTALLPREFIX := notset
PREFIXSUFFIX := $(shell $(OSGPOOL)/CommonConf/config.guess)
-include .prefix.$(PREFIXSUFFIX)
ifneq ($(OSGINSTALLPREFIX),notset)
OSGCONFIG := $(OSGINSTALLPREFIX)/bin/osg-config
endif
ifneq ($(OSGROOT),)
OSGCONF := $(wildcard $(OSGROOT)/bin/osg-config)
ifneq ($(OSGCONF),)
OSGCONFIG := $(OSGCONF)
endif
endif
# if configure info wasn't found, maybe a Builds/* install?
ifeq ($(OSGCONFIG),notset)
INSTALLROOT := $(wildcard ../Builds/$(shell ../CommonConf/config.guess)-*)
OSGCONF := $(wildcard $(INSTALLROOT)/bin/osg-config)
ifneq ($(OSGCONF),)
OSGCONFIG := $(OSGCONF)
endif
endif
# maybe we can find it in the path?
ifeq ($(OSGCONFIG),notset)
OSGCONF := \
$(shell if which osg-config >/dev/null 2>&1; then which osg-config; fi )
OSGCONF := $(strip $(OSGCONF))
ifneq ($(OSGCONF),)
OSGCONFIG := $(OSGCONF)
endif
endif
# ok, give up
ifeq ($(OSGCONFIG),notset)
$(error Can't find osg-config, please configure the Makefile or \
add it to your PATH)
endif
### System dependencies ###############################################
# Set the system we're running on
SYSTEM := $(shell uname)
# which extension to be used for executables
EXEEXT :=
# which extension to be used for executables
ADDLIB :=
# be very careful with these lines. There needs to be a space after the Unix
# lines and nothing after the win lines!!
ifeq ($(SYSTEM),IRIX)
CCOUT := -o
LDOUT := -o
LINK :=
ADDLIB := X
endif
ifeq ($(SYSTEM),IRIX64)
CCOUT := -o
LDOUT := -o
LINK :=
ADDLIB := X
endif
ifeq ($(SYSTEM),Linux)
CCOUT := -o
LDOUT := -o
LINK :=
ADDLIB := X
endif
ifeq ($(findstring WIN,$(SYSTEM)),WIN)
OS := WIN32
CCOUT := -Fo
LDOUT := /out:
LINK := -link
EXEEXT :=.exe
endif
ifeq ($(SYSTEM),HP-UX)
CCOUT := -o
LDOUT := -o
LINK :=
ADDLIB := X
endif
ifeq ($(SYSTEM),Darwin)
CCOUT := -o
LDOUT := -o
LINK :=
endif
# Var settings
ifeq ($(findstring WIN,$(SYSTEM)),WIN)
CC = "$(shell $(OSGCONFIG) --compiler)"
else
CC = $(shell $(OSGCONFIG) --compiler)
endif
CCFLAGS = $(shell $(OSGCONFIG) --cflags --$(LIBTYPE) Base System $(ADDLIB) GLUT)
LDFLAGS = $(LINK) $(shell $(OSGCONFIG) --libs --$(LIBTYPE) Base System $(ADDLIB) GLUT)
# all tutorials in this directory
TUTS := $(wildcard [0-9][0-9]*.cpp)
PROGS := $(TUTS:.cpp=$(EXEEXT))
ifeq ($(findstring WIN,$(SYSTEM)),WIN)
TUTS := $(filter-out %X.cpp, $(TUTS))
endif
# program dependencies
default: $(PROGS)
# make rules
.PHONY: clean Clean
clean:
rm -f *.o
rm -f *.obj
rm -rf ii_files
rm -f *.pdb
rm -f *.ilk
rm -f *.idb
Clean: clean
rm -f $(PROGS)
%.o: %.cpp
$(CC) -c $(CCFLAGS) $<
%: %.o
$(CC) $(LDOUT)$@ $< $(LDFLAGS)
%$(EXEEXT): %.cpp
$(CC) $(CCFLAGS) $< $(LDFLAGS) $(LDOUT)$@
When I tried to configure and compile opensg again and tried to make the tutorial it showed the following error which is slightly different from the previous error. I had encountered this error before but it had changed. The error:
ani@anilap:~/OpenSG/Tutorials$ make
g++ -D_GNU_SOURCE -DQT_CLEAN_NAMESPACE -DOSG_WITH_GLUT -DOSG_WITH_TIF -DOSG_WITH_JPG -DOSG_WITH_PNG -D_OSG_HAVE_CONFIGURED_H_ -DQT_NO_XINERAMA -DQT_NO_XRENDER -DQT_NO_XFTFREETYPE -DQT_NO_XKB -DQT_NO_SM_SUPPORT -DQT_NO_IMAGEIO_MNG -DQT_NO_IMAGEIO_JPEG -DQT_NO_STYLE_AQUA -DQT_NO_STYLE_MAC -DQT_NO_STYLE_INTERLACE -DQT_NO_STYLE_COMPACT -ansi -use_readonly_const -ftemplate-depth-100 -g -DOSG_DEBUG -DOSG_WITH_GLUT -DOSG_WITH_TIF -DOSG_WITH_JPG -DOSG_WITH_PNG -I/usr/local/include 01hello.cpp -g -L/usr/local/lib/dbg -lOSGWindowGLUT -lOSGWindowX -lOSGSystem -lOSGBase -ltiff -ljpeg -lpng -lz -lglut -lGLU -lGL -lXmu -lXi -lXt -lX11 -lpthread -ldl -lm -L/usr/X11R6/lib -o 01hello
In file included from /usr/include/c++/4.4/ext/hash_map:60,
from /usr/local/include/OpenSG/OSGWindow.h:53,
from /usr/local/include/OpenSG/OSGGeometry.h:48,
from /usr/local/include/OpenSG/OSGSimpleGeometry.h:49,
from 01hello.cpp:19:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-depr开发者_如何学Goecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
make: *** [01hello] Error 1
ani@anilap:~/OpenSG/Tutorials$
17-03-2011 The new errors that i encountered while I tried to make the tutorial after installing the missing library:
ani@anilap:~/OpenSG$ cd Tutorials/
ani@anilap:~/OpenSG/Tutorials$ make
g++ -D_GNU_SOURCE -DQT_CLEAN_NAMESPACE -DOSG_WITH_GLUT -DOSG_WITH_TIF
-DOSG_WITH_JPG - DOSG_WITH_PNG -D_OSG_HAVE_CONFIGURED_H_ -DQT_NO_XINERAMA -DQT_NO_XRENDER -DQT_NO_XFTFREETYPE -DQT_NO_XKB -DQT_NO_SM_SUPPORT -DQT_NO_IMAGEIO_MNG -DQT_NO_IMAGEIO_JPEG -DQT_NO_STYLE_AQUA -DQT_NO_STYLE_MAC -DQT_NO_STYLE_INTERLACE -DQT_NO_STYLE_COMPACT -ansi -use_readonly_const -ftemplate-depth-100 -g -DOSG_DEBUG -DOSG_WITH_GLUT -DOSG_WITH_TIF -DOSG_WITH_JPG -DOSG_WITH_PNG -I/usr/local/include 18opengl_slave.cpp -g -L/usr/local/lib/dbg -lOSGWindowGLUT -lOSGWindowX -lOSGSystem -lOSGBase -ltiff -ljpeg -lpng -lz -lglut -lGLU -lGL -lXmu -lXi -lXt -lX11 -lpthread -ldl -lm -L/usr/X11R6/lib -o 18opengl_slave
In file included from /usr/include/c++/4.4/ext/hash_map:60,
from /usr/local/include/OpenSG/OSGWindow.h:53,
from /usr/local/include/OpenSG/OSGGeometry.h:48,
from /usr/local/include/OpenSG/OSGSimpleGeometry.h:49,
from 18opengl_slave.cpp:21:
/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use
-Wno-deprecated.
18opengl_slave.cpp:70: error: ‘<anonymous>’ has incomplete type
18opengl_slave.cpp:70: error: invalid use of ‘GLvoid’
18opengl_slave.cpp: In function ‘GLvoid InitGL(GLsizei, GLsizei)’:
18opengl_slave.cpp:70: error: too few arguments to function ‘GLvoid LoadGLTextures(<type error>)’
18opengl_slave.cpp:92: error: at this point in file
18opengl_slave.cpp: At global scope:
18opengl_slave.cpp:310: error: ‘<anonymous>’ has incomplete type
18opengl_slave.cpp:310: error: invalid use of ‘GLvoid’
18opengl_slave.cpp: In function ‘int main(int, char**)’:
18opengl_slave.cpp:486: error: invalid conversion from ‘GLvoid (*)(<type error>)’ to ‘void (*)()’
18opengl_slave.cpp:486: error: initializing argument 1 of ‘void glutDisplayFunc(void (*)())’
make: *** [18opengl_slave] Error 1
ani@anilap:~/OpenSG/Tutorials$
Look at this line:
/usr/bin/ld: cannot find -lXmu
That means that you miss a library on your system. The name of that library is libxmu. You need to install the development package for it. If you are using ubuntu, you can do it using the following command:
apt-get install libxmu-dev
精彩评论