在Ubuntu下编译Coin3D时,使用的gcc如果是4.6版,会给出错误提示:
../../include/Inventor/SbVec2s.h:72:83: required from here
../../include/Inventor/SbBasic.h:99:5: error: 'cc_debugerror_post' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from ../../include/Inventor/errors/SoDebugError.h:28:0,
from ../../include/Inventor/SbVec2s.h:32,
from ../../include/Inventor/SbViewportRegion.h:28,
from ../../include/Inventor/actions/SoGLRenderAction.h:30,
from SoGLRenderAction.cpp:56:
../../include/Inventor/C/errors/debugerror.h:59:19: note: 'void cc_debugerror_post(const char*, const char*, ...)' declared here, later in the translation unit
In file included from ../../include/Inventor/actions/SoAction.h:27:0,
from ../../include/Inventor/actions/SoGLRenderAction.h:27,
from SoGLRenderAction.cpp:56:
此时,需要为编译指定使用gcc4.7做编译器,并使用 -fpermissive 选项。
参考ubuntu 官方的bug说明 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667139
命令如下:
./configure CCFLAGS=-fpermissive CXXFLAGS=-fpermissive CC=gcc-4.7 CXX=g++-4.7 --prefix=/home/anklean/work/repos
make
make install
../../include/Inventor/SbVec2s.h:72:83: required from here
../../include/Inventor/SbBasic.h:99:5: error: 'cc_debugerror_post' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from ../../include/Inventor/errors/SoDebugError.h:28:0,
from ../../include/Inventor/SbVec2s.h:32,
from ../../include/Inventor/SbViewportRegion.h:28,
from ../../include/Inventor/actions/SoGLRenderAction.h:30,
from SoGLRenderAction.cpp:56:
../../include/Inventor/C/errors/debugerror.h:59:19: note: 'void cc_debugerror_post(const char*, const char*, ...)' declared here, later in the translation unit
In file included from ../../include/Inventor/actions/SoAction.h:27:0,
from ../../include/Inventor/actions/SoGLRenderAction.h:27,
from SoGLRenderAction.cpp:56:
此时,需要为编译指定使用gcc4.7做编译器,并使用 -fpermissive 选项。
参考ubuntu 官方的bug说明 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667139
命令如下:
./configure CCFLAGS=-fpermissive CXXFLAGS=-fpermissive CC=gcc-4.7 CXX=g++-4.7 --prefix=/home/anklean/work/repos
make
make install