2011-03-09 130 views
0

我在这里有一些情况。我正在尝试与OpenSG合作。我下载了包并按照INSTALL文件中的指示进行安装。然后我安装了系统依赖库。现在我试图构建它的教程,它显示错误。它说glut没有配置,但我启用了glut库,而我配置它并安装了所有依赖包和库。我不明白这个问题是什么。 而试图使OpenSG教程中显示的错误如下:使用OpenSG渲染

[email protected]:~/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 
[email protected]:~/OpenSG/Tutorials$ 

如果有人可以帮助我找到一个解决这个我会很感激。

本教程的makefile文件如下:

# 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)[email protected] $< $(LDFLAGS) 

%$(EXEEXT): %.cpp 
    $(CC) $(CCFLAGS) $< $(LDFLAGS) $(LDOUT)[email protected] 

当我试图重新配置并编译opensg,并试图使本教程它显示下面的错误是从以前的错误略有不同。之前我遇到过这个错误,但它已经改变了。错误:

[email protected]:~/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-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. 
/usr/bin/ld: cannot find -lXmu 
collect2: ld returned 1 exit status 
make: *** [01hello] Error 1 
[email protected]:~/OpenSG/Tutorials$ 

17-03-2011 ,我遇到了,而我试图使安装缺少的库后,本教程中的新的错误:

[email protected]:~/OpenSG$ cd Tutorials/ 
[email protected]:~/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 
    [email protected]:~/OpenSG/Tutorials$ 
+0

您的Makefile看起来很糟糕:g ++在第一行抱怨不好。你能复制过去吗? – tibur 2011-03-09 17:17:57

+0

当然..本教程可以在包中找到。 – Ani 2011-03-10 05:25:34

+0

@tibur:不同的错误交替出现。这是我第一次处理makefile。你能帮我制作makefile吗? – Ani 2011-03-10 06:50:33

回答

0

看这句话:

/usr/bin/ld: cannot find -lXmu 

这意味着你错过了系统上的库。该库的名称是libxmu。您需要为其安装开发包。如果您使用的是Ubuntu,您可以使用以下命令:

apt-get install libxmu-dev 
+0

谢谢,我安装了该库,然后试着在教程上做了一些程序,但其他人没有。当我尝试更新依赖项时,我无法做到,因为in.archive.ubuntu网站在某些情况下没有连接。我明白。我发布了新的错误。如果你能帮助我理解,我会很感激。 – Ani 2011-03-17 07:24:46

+0

先生你能帮我理解我为什么不能正确安装opensg吗?可能是什么问题呢?我能够在给定的教程中创建某些文件,但其他人无法使用。运行示例程序时,程序包不会识别自己的文件。当我尝试配置并打开opensg时有warnng,但我可以安装它。如果你能帮助,我将不胜感激。我也在寻找一个python绑定opensg,但我找不到一个。 – Ani 2011-03-21 18:55:25

+0

嘿!我找出了问题所在。该软件包已安装,但我没有正确地查看错误。谢谢 :) – Ani 2011-03-26 20:06:49