无法将“ bool”转换为“ gzfile {aka gzfile_s*}”
Cannot convert ‘bool’ to ‘gzFile {aka gzFile_s*}’
我是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_in
是pointer to gzFile_s
类型。将BOOL变量分配给指针类型不会编译。因此,错误消息。用指针文字std::nullptr
或宏NULL
替换vcf_file.cpp
内的false
,然后重新运行Makefile。
顺便说一句。我在VCF的GitHub存储库中检查了VCF_FILE.CPP文件。它们不包含导致上述错误的线路。愿您有一个过时的/修改的版本,引入了编译器错误。
相关文章:
- 将 Vcl::Controls::TCaption aka (System::UnicodeString) 转换为 co
- 为什么 ## aka 令牌粘贴运算符不适用于 C 和 C++ 中的注释?
- 从"const void*"到"PVOID {aka void*}"[-fall
- 将"std::string {aka std::basic_string}"赋值中的不兼容类型<char>
- 错误:从'void*'到'const uint8_t* {aka const unsigned char*}'的转换无效 [-允许]
- 错误:为"运算符 std::string {aka std::__cxx11::basic_string}"指定的返回类型<char>
- 与'operator<<'不匹配(操作数类型'std::ostream {aka std::basic_ostream<char>}'
- 错误:请求从"Mstream"转换为非标量类型"std::string {aka std::basic_string<char>}"
- 从"SymbolInfo*"转换为"YYSTYPE {aka int}"会失去精
- 错误:无法将'uint8* {aka unsigned int*}'转换为"常量emxArray_uint8_T*"?
- 错误:无法将"std::istream {aka std::basic_istream<char>}"lvalue 绑定到"std::basic_istream&<char>&
- 使用 /clr 或 clr:pure (cpprestsdk aka casablanca) 编译时不支持互斥
- C++错误:将"const umap_int {aka const std::unordered_map<int, int>}"作为"this"参数会丢弃限定符 [-permissive]
- 返回"Cannot convert from 'std::ofstream {aka std::basic_ofstream<char>}' to bool"错误
- \main.cpp|103|error: 与"operator<<"不匹配(操作数类型为"std::ostream {aka std::basic_ostream<char&g
- 无法将“ bool”转换为“ gzfile {aka gzfile_s*}”
- 从“ int”到'int16_t {aka short int}'内部{}的“((int)a) -1)”的缩小转换
- 从'byte* {aka unsigned char*}'到'dword {aka长unsigned int}'失去精度
- 错误:无法将"std::ostream {aka std::basic_ostream<char>}"lvalue 绑定到"std::basic_ostream&<char>&
- high_resolution_clock错误:无法将"std::ostream {aka std::basic_ostream}"<char>lvalue 绑定到"std::basic_