无法将“ bool”转换为“ gzfile {aka gzfile_s*}”

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

本文关键字:gzfile aka bool 转换      更新时间:2023-10-16

我是Linux环境的新手,并尝试安装BioInformatics软件包(vcftools -https://vcftools.gith.github.io/examples.html)。由于某些原因,我可以在Cygwin环境中没有问题而没有问题,其他同事也没有小故障安装了软件包,但是如果我尝试在同一台计算机上的VirtualBox中的Ubuntu环境中进行编译,我会遇到错误(以下)。我会收到以下错误。有人对如何解决此错误有建议吗?

$ make install

输出

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:在构造函数中 ** vcf_file.cpp:25:13:**错误:无法将'bool'**转换为'gzfile {aka gzfile_s*}' gzvcf_in = false;

gzvcf_inpointer to gzFile_s类型。将BOOL变量分配给指针类型不会编译。因此,错误消息。用指针文字std::nullptr或宏NULL替换vcf_file.cpp内的false,然后重新运行Makefile。


顺便说一句。我在VCF的GitHub存储库中检查了VCF_FILE.CPP文件。它们不包含导致上述错误的线路。愿您有一个过时的/修改的版本,引入了编译器错误。

相关文章: