0

我是 Linux 环境的新手,正在尝试安装生物信息学软件包(vcftools - https://vcftools.github.io/examples.html)。出于某种原因,我可以在 Cygwin 环境中毫无问题地编译,其他同事已经安装了该软件包而没有出现故障,但是如果我尝试在同一台计算机上的 VirtualBox 中的 Ubuntu 环境中编译,我会收到错误(如下所示)。我收到以下错误。有人对如何解决此错误有建议吗?

$make 安装

输出

Installing VCF tools
make[1]: Entering directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
g++ -c -O2 -D_FILE_OFFSET_BITS=64  vcftools.cpp -o vcftools.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64  vcftools.cpp > vcftools.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64  bcf_file.cpp -o bcf_file.o
g++ -MM -O2 -D_FILE_OFFSET_BITS=64  bcf_file.cpp > bcf_file.d
g++ -c -O2 -D_FILE_OFFSET_BITS=64  vcf_file.cpp -o vcf_file.o
vcf_file.cpp: In constructor ‘vcf_file::vcf_file()’:
**vcf_file.cpp:25:13: **error: cannot convert ‘bool’** to ‘gzFile {aka gzFile_s*}’ in assignment**
  gzvcf_in = false;
             ^~~~~
Makefile:53: recipe for target 'vcf_file.o' failed
make[1]: *** [vcf_file.o] Error 1
make[1]: Leaving directory '/home/wde/selt/selectionTools/vcftools_0.1.11/cpp'
/bin/sh: 2: cd: can't cd to perl
Makefile:24: recipe for target 'install' failed
make: *** [install] Error 2
error with make
4

1 回答 1

1

基本上,makefile 所做的就是自动调用编译器。因此,makefile 的输出类似于您得到的通常编译错误,即从命令行编译源文件。上面错误日志中的重要行是:

vcf_file.cpp:在构造函数 'vcf_file::vcf_file()' 中:
**vcf_file.cpp:25:13:**错误:无法在分配中将 'bool'** 转换为 'gzFile {aka gzFile_s*}' gzvcf_in =假;

gzvcf_in是类型pointer to gzFile_s。将 bool 变量分配给指针类型不会编译。因此,错误消息。用指针文字或宏替换vcf_file.cpp,内部并重新运行生成文件。falsestd::nullptrNULL


顺便提一句。我从 vcf 检查了github repo 中的vcf_file.cpp 文件。它们不包含导致上述错误的行。可能你有一个过时/修改的版本,引入编译器错误。

于 2017-02-28T14:41:57.063 回答