无法将“bool”转换为“gzFile {aka gzFile_s*}”

Cannot convert ‘bool’ to ‘gzFile {aka gzFile_s*}’

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

$制作安装

输出

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

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

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;

gzvcf_inpointer to gzFile_s 类型。将 bool 变量分配给指针类型不会编译。 因此,错误消息。在 vcf_file.cppfalse 内用指针文字 std::nullptr 或宏 NULL 替换并重新 运行 生成文件。


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