Cython认为构造函数有一个额外的参数

时间:2017-12-04 21:15:51

标签: python cython

我正在尝试从GitHub构建MultiNEAT项目。 https://github.com/peter-ch/MultiNEAT

我在Ubuntu 16.04上运行python 3.5.2,Cython版本为0.27.3,gcc版本为5.4.0。当我按照GitHub指令使用Cython构建时,我得到以下错误

_MultiNEAT.cpp:19088:166: error: no matching function for call to ‘NEAT::Genome::Genome(unsigned int&, unsigned int&, unsigned int&, unsigned int&, bool&, NEAT::ActivationFunction&, NEAT::ActivationFunction&, unsigned int&, NEAT::Parameters&)’
     __pyx_v_self->thisptr = new NEAT::Genome(__pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24, (*__pyx_v_a_ps->thisptr));
                                                                                                                                                                      ^
In file included from src/Innovation.h:37:0,
                 from src/Population.h:36,
                 from _MultiNEAT.cpp:589:
src/Genome.h:193:9: note: candidate: NEAT::Genome::Genome(unsigned int, unsigned int, unsigned int, unsigned int, bool, NEAT::ActivationFunction, NEAT::ActivationFunction, unsigned int, const NEAT::Parameters&, unsigned int)
         Genome(unsigned int a_ID,
         ^
src/Genome.h:193:9: note:   candidate expects 10 arguments, 9 provided
src/Genome.h:189:9: note: candidate: NEAT::Genome::Genome(unsigned int, unsigned int, unsigned int, unsigned int, NEAT::ActivationFunction, NEAT::ActivationFunction, const NEAT::Parameters&)
         Genome(unsigned int a_ID, unsigned int a_NumInputs, unsigned int a_NumHidden, unsigned int a_NumOutputs,
         ^
src/Genome.h:189:9: note:   candidate expects 7 arguments, 9 provided
src/Genome.h:186:9: note: candidate: NEAT::Genome::Genome(std::ifstream&)
         Genome(std::ifstream &a_DataFile);
         ^
src/Genome.h:186:9: note:   candidate expects 1 argument, 9 provided
src/Genome.h:183:9: note: candidate: NEAT::Genome::Genome(const char*)
         Genome(const char *a_filename);
         ^
src/Genome.h:183:9: note:   candidate expects 1 argument, 9 provided
src/Genome.h:170:9: note: candidate: NEAT::Genome::Genome(const NEAT::Genome&)
         Genome(const Genome &a_g);
         ^
src/Genome.h:170:9: note:   candidate expects 1 argument, 9 provided
src/Genome.h:167:9: note: candidate: NEAT::Genome::Genome()
         Genome();
         ^
src/Genome.h:167:9: note:   candidate expects 0 arguments, 9 provided
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

然而,当我检查Genome.h文件时,它显然有一个带有9个参数的构造函数,而且似乎Cython正在复制ActivationFunction参数,原因是我无法弄清楚。任何有关使用Cython构建此项目的见解都将不胜感激。

注意:当我第一次尝试构建时,它给出了一个关于没有函数Age()的类的错误我只是从该print语句中删除了对Age()的引用继续并得到当前错误。

0 个答案:

没有答案