GCC 4.7.x needs '-fpermissive' in CXXFLAGS? (0.5.1-r1)
Posted: Tue Oct 30, 2012 10:41 pm
Just getting started with VS and trying to compile per the instructions, I get this error (config.log attached) on XUbuntu 12.10 x64:
Any tips/pointers much appreciated.
EDIT: Adding '-fpermissive' to CXXFLAGS per the error message (and after reading this Arch Linux packaging discussion) seems to have solved the issue.
EDIT2: "make -j2" works fine. Neat. It takes 7m30s to build on my old-ish C2D Pentium E5700 3GHz box w/-j2 on a slow disk with cold cache.
EDIT3: On the odd chance that someone else sees this, it turns out that ./configure actually has an option that adds -fpermissive to CXXFLAGS in the generated Makefile. It's simply a question of adding the argument "--enable-permissive" to ./configure (see "./configure --help" for more interesting options)
Code: Select all
depbase=`echo src/gfx/quadsquare.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I./boost/1_45 -DHAVE_SDL=1 -DSDL_WINDOWING=1 -DHAVE_AL=1 -DHAVE_OGG -DNV_CUBE_MAP=1 -DDATA_DIR=\"/home/ermo/VegaStrike/0.5.1-r1/data\" -I/usr/include/python2.7 -DHAVE_PYTHON=1 -I./src -pipe -DNV_CUBE_MAP -O2 -ffast-math -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -pthread -MT src/gfx/quadsquare.o -MD -MP -MF $depbase.Tpo -c -o src/gfx/quadsquare.o src/gfx/quadsquare.cpp &&\
mv -f $depbase.Tpo $depbase.Po
In file included from src/gfx/quadsquare.h:18:0,
from src/gfx/quadsquare.cpp:16:
./src/resizable.h: In instantiation of ‘Resizable<ITEM>::Resizable(const Resizable<ITEM>&) [with ITEM = unsigned int]’:
src/gfx/quadsquare.h:71:8: required from ‘void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = TextureIndex; _Alloc = std::allocator<TextureIndex>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<TextureIndex*, std::vector<TextureIndex> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = TextureIndex*]’
/usr/include/c++/4.7/bits/stl_vector.h:893:4: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = TextureIndex; _Alloc = std::allocator<TextureIndex>; std::vector<_Tp, _Alloc>::value_type = TextureIndex]’
src/gfx/quadsquare.cpp:351:47: required from here
./src/resizable.h:19:9: error: ‘memcpy’ 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 /usr/include/string.h:642:0,
from ./src/pk3.h:42,
from ./src/vsfilesystem.h:13,
from src/gfx/vsimage.h:4,
from src/gfx/aux_texture.h:23,
from src/gfx/quadsquare.cpp:18:
/usr/include/x86_64-linux-gnu/bits/string3.h:49:1: note: ‘void* memcpy(void*, const void*, size_t)’ declared here, later in the translation unit
make[1]: *** [src/gfx/quadsquare.o] Error 1
make[1]: Leaving directory `/home/ermo/VegaStrike/0.5.1-r1/vegastrike'
make: *** [all] Error 2
EDIT: Adding '-fpermissive' to CXXFLAGS per the error message (and after reading this Arch Linux packaging discussion) seems to have solved the issue.
EDIT2: "make -j2" works fine. Neat. It takes 7m30s to build on my old-ish C2D Pentium E5700 3GHz box w/-j2 on a slow disk with cold cache.
EDIT3: On the odd chance that someone else sees this, it turns out that ./configure actually has an option that adds -fpermissive to CXXFLAGS in the generated Makefile. It's simply a question of adding the argument "--enable-permissive" to ./configure (see "./configure --help" for more interesting options)