当我尝试在Ubuntu 14.04 32位桌面版中编译galib247时,我收到一个错误。这是错误:
^
../ga/GA2DArrayGenome.C:292:71: note: declarations in dependent base ‘GAGenome’ are not found by unqualified lookup
../ga/GA2DArrayGenome.C:292:71: note: use ‘this->crossover’ instead
make[1]: *** [ex17.o] Error 1
make[1]: Leaving directory `/home/alumno/galib247/examples'
make: *** [ex] Error 2
我编辑makevars文件取消注释适当的代码块。这是我所做的改变:
### Uncomment a block from the list below appropriate for the compiler and
### operating system on which you are compiling.
# gcc3, gcc4
# verified 28dec04 on linux-x86 (fedora core 2 with gcc 3.3.3)
# verified 28dec04 on linux-ppc (yellow dog 3 with gcc 3.2.2)
# verified 28dec04 on win2k-x86 (cygwin-win2k with gcc 3.3.3)
# verified 10jan05 on linux-x86 (fedora core 3 with gcc 3.4.2)
# verified 06mar07 on linux-x86 (debian with gcc 3.3.5)
# verified 06mar07 on linux-x86 (ubuntu with gcc 4.0.3)
# verified 06mar07 on macosx-ppc (macosx 10.4.8 with gcc 4.0.1)
CXX = g++
CXXFLAGS = -g -Wall
LD = g++ -w
AR = ar rv
INSTALL = install -c
RANLIB = echo no ranlib
我没有做任何其他改变。这个库已在DevC ++中测试过,但我不想使用这个IDE。
有什么想法吗?
答案 0 :(得分:0)
解决方案:
在CXXFLAGS中更改makevars文件添加-fpermissive。
# gcc3, gcc4
# verified 28dec04 on linux-x86 (fedora core 2 with gcc 3.3.3)
# verified 28dec04 on linux-ppc (yellow dog 3 with gcc 3.2.2)
# verified 28dec04 on win2k-x86 (cygwin-win2k with gcc 3.3.3)
# verified 10jan05 on linux-x86 (fedora core 3 with gcc 3.4.2)
# verified 06mar07 on linux-x86 (debian with gcc 3.3.5)
# verified 06mar07 on linux-x86 (ubuntu with gcc 4.0.3)
# verified 06mar07 on macosx-ppc (macosx 10.4.8 with gcc 4.0.1)
CXX = g++
CXXFLAGS = -g -fpermissive -Wall
LD = g++ -w
AR = ar rv
INSTALL = install -c
RANLIB = echo no ranlib
然后
make clean
make