vk-com / kphp-kdb

VK-KittenPHP/DB/Engine suite
GNU General Public License v2.0
6.14k stars 220 forks source link

Ошибка сборки (error: redefinition of ‘time_amortization_table_fast_exp’) #26

Open pensnarik opened 7 years ago

pensnarik commented 7 years ago
vv/am-amortization.c:59:8: error: redefinition of ‘time_amortization_table_fast_exp’
 double time_amortization_table_fast_exp (time_amortization_table_t *self, int dt) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from vv/am-amortization.c:23:0:
vv/am-amortization.h:42:22: note: previous definition of ‘time_amortization_table_fast_exp’ was here
 extern inline double time_amortization_table_fast_exp (time_amortization_table_t *self, int dt) {
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:280: recipe for target 'objs/vv/am-amortization.o' failed
make: *** [objs/vv/am-amortization.o] Error 1
make: *** Waiting for unfinished jobs....

Если закомментировать одно из объявлений, получаю ошибку на этапе линковки:

objs/vv/am-amortization.o: In function `time_amortization_table_fast_exp':
/home/mutex/src/kphp-kdb/vv/am-amortization.h:44: multiple definition of `time_amortization_table_fast_exp'
objs/targ/targ-weights.o:/home/mutex/src/kphp-kdb/vv/am-amortization.h:44: first defined here
collect2: error: ld returned 1 exit status
Makefile:329: recipe for target 'objs/bin/targ-engine' failed
make: *** [objs/bin/targ-engine] Error 1
make: *** Waiting for unfinished jobs....
[mutex@hp kphp-kdb]$ (master)*$ mc
ximik777 commented 7 years ago

Собирайтесь через gcc <= 4.9

pensnarik commented 7 years ago

Попробовал 4.8 и 4.9, столкнулся с другой проблемой (make kphp):

In file included from KPHP/runtime/regexp.cpp:29:0:
/usr/include/re2/re2.h:734:16: error: ‘once_flag’ in namespace ‘std’ does not name a type
   mutable std::once_flag rprog_once_;
                ^

А если передавать флаг -std=c++11, тогда:

KPHP/runtime/drivers.h:567:30: error: expected ‘;’ before ‘it’
   for (typeof (keys.begin()) it = keys.begin(); it != keys.end(); ++it) {
                              ^

И много других подобных ошибок.