草庐IT

make_them_different

全部标签

c++ - make 失败,返回错误 "cannot convert ‘std::istream {aka std::basic_istream<char>}’ 到 ‘bool’”

我正在尝试从源代码编译libgtextutils(fastxtoolkit需要)。“./configure”命令运行良好,但随后的“make”命令产生了一个我无法解决的错误。text_line_reader.cpp:Inmemberfunction‘boolTextLineReader::next_line()’:text_line_reader.cpp:47:9:error:cannotconvert‘std::istream{akastd::basic_istream}’to‘bool’inreturnreturninput_stream;^~~~~~~~~~~~make[3]:*

c++ - Win32 文件锁定读取 : how to find out who's locking them

在C++中(特别是在VisualC++中),有时您无法打开一个文件,因为另一个可执行文件已经打开并且没有共享它以供读取。如果我尝试打开这样的文件,我如何以编程方式找出谁在锁定该文件? 最佳答案 在Windows2000及更高版本中,如果不使用内核模式驱动程序,则无法执行此操作。ProcessExplorer和其他类似工具会自动加载驱动程序来完成此操作。这是因为文件句柄位于内核空间中,用户模式应用程序(EXE文件)无法访问。如果你真的有兴趣这样做,看看thisproject. 关于c++-

c++ - g++ 和 clang++ 在 `std::make_index_sequence` 和 `std::index_sequence` 用于模板参数默认类型时的不同行为

另一个“g++和clang++之间谁是正确的?”C++标准专家的问题。给定以下代码#includetemplate>structfoo;templatestructfoo>{};templatevoidbar(fooconst&){}intmain(){bar(foo{});}我看到g++编译时clang++给出了以下错误tmp_003-14,gcc,clang.cpp:32:4:error:nomatchingfunctionforcallto'bar'bar(foo{});^~~tmp_003-14,gcc,clang.cpp:27:6:note:candidatetemplate

c++ - GNU Make 产生完全不同的结果

这令人困惑。我有我的Makefile:OBJECTS=INCLUDE_BUILD_PATH=/Users/wen/Projects/include#ChangecompilationsettingshereCOMPILE=g++overrideCOMPILE_FLAGS+=-O2#Changelinker/compilerspecificsettingshereLD_FLAGS:=CC_FLAGS:=-c-I$(INCLUDE_BUILD_PATH)/bigint#AddsourceextensionshereSRC_EXT=cppcc#Addheaderdependenciesher

c++ - CMake: "make depend"的用途是什么?

cmake生成的目标之一是depend:ThefollowingaresomeofthevalidtargetsforthisMakefile:...all(thedefaultifnotargetisprovided)...clean...depend...edit_cache...rebuild_cache执行“makedepend”会有什么影响? 最佳答案 这构建了Makefile的某些目标的依赖关系规则。参见http://en.wikipedia.org/wiki/Makedepend

c++ - 未找到 difference_type

当我尝试使用std::distance时使用gcc4.7下的自定义迭代器,它提示找不到difference_type.遗憾的是,我不知道为什么会失败。#includeclassnit{public:typedefintdifference_type;};intmain(){constnittest1;std::distance(test1,test1);return0;}给出错误:/usr/include/c++/4.7/bits/stl_iterator_base_funcs.h:114:5:error:notypenamed‘difference_type’in‘structstd

c++ - decltype(自动),尾随返回类型和 sfinae : can we mix them?

考虑以下代码:autof()->decltype(auto){/*dowhateveryouwanthere*/}intmain(){f();}推导出返回类型,decltype(auto)用作尾随返回类型。下面的代码是一个稍微修改过的(实际上,sfinae'd)版本:structS{staticvoidf(){}};structT{};templateautof(int)->decltype(U::f(),void()){//dowhateveryouwanthere}templateautof(char)->decltype(auto){//dowhateveryouwanthere

c++ - "...redeclared as different kind of symbol"?

#include#includedoubleintegrateF(doublelow,doublehigh){doublelow=0;doublehigh=20;doubledelta_x=0;doublex,ans;doubles=1/2*exp((-x*x)/2);for(x=low;x它说low和high被“重新声明为不同类型的符号”,我不知道那是什么意思。基本上,我在这里所做的一切(阅读:尝试)是从低(我设置为0)到高(20)积分以找到黎曼和。for循环看起来也有点迷幻……我迷路了。编辑:#include#includedoubleintegrateF(doublelow,do

c++ - Qt 需要 C++11 支持"make error

我尝试按照README.md中的说明从源代码编译最新的平铺。我的工作环境:平铺源代码:tiled-0.16.1Mac操作系统:10.11.1Xcode:7.1Q制作:3.0Qt:5.7.0苹果LLVM:7.0.0但是make失败并出现以下错误:Infileincludedfrompythonplugin.cpp:21:Infileincludedfrom./pythonplugin.h:30:Infileincludedfrom../../libtiled/logginginterface.h:33:Infileincludedfrom../../libtiled/tiled_glob

c++ - C 和 C++ : Difference between Casting and Conversion

下面代码中第2行和第3行有什么区别吗?编译器在每种情况下做什么?charch='A';//line1inti=ch;//line2intj=(int)ch;//iine3一般来说,转换和转换(在C和C++中)有什么区别? 最佳答案 最终效果没有区别。cast是使用显式的、通用的、内置的castnotation进行转换。尽管在某些情况下,当我们指的是从Derived*到Base*(或从Derived&到Base&)的隐式转换时,我们会说“向上转换”。在某些情况下,人们定义了新的转换符号。术语的上述定义只是一个操作定义,也就是说,它不是