草庐IT

default-compile

全部标签

c++ - '/usr/lib/i386-linux-gnu/qt5/bin/lrelease : not found WARNING: TARGET is empty' Error when trying to compile Feathercoin from source

我关注this从源代码安装羽毛币的提示。我已按照所有说明进行操作,直至:qmake'USE_UPNP=-`make这就是我得到以下错误的地方:1:/usr/lib/i386-linux-gnu/qt5/bin/lrelease:notfoundWARNING:TARGETisempty`下面是终端输出:RCC:Errorin'src/qt/bitcoin.qrc':Cannotfindfile'locale/bitcoin_bg.qm'RCC:Errorin'src/qt/bitcoin.qrc':Cannotfindfile'locale/bitcoin_ca_ES.qm'RCC:E

c++ - 可变参数模板和函数的指针 : what compiler is right?

我找不到更好的标题,但如果您有正确的想法,请随时修改它。事实上,它还是比GCCvsclang好。我试图找出这段代码有什么问题:templatestructS;templatestructS:S{usingS::f;templatevoidf(){}};templatestructS{voidf();};templatestructR:S{usingS::f;templatevoidg(){this->templatef();}};voidh(constdouble&){}intmain(){Rr;r.g();}它可以用GCC4.9编译(参见here),但它不能用clang3.8.0编译

c++ - target_compile_options() 仅适用于 C++ 文件?

是否可以仅将target_compile_options()用于C++文件?我想将它用于作为其他应用程序依赖项的目标,以便库可以将其编译器标志传播到这些应用程序。但是,如果与C或ObjC文件一起使用,某些标志(例如-std=c++14)会导致构建失败。我读过我应该CXX_FLAGS而不是只将这些标志添加到C++文件中,但这不会(自动)通过cmake的包系统传播。 最佳答案 解决方案您可以使用generatorexpressions来执行此操作:target_compile_options(MyLibPUBLIC$:-std=c++1

c++ - 错误 C2512 : no appropriate default constructor available

我收到这个烦人的错误,我不知道为什么=(!这是问题,我解决了,但构造函数有问题。WriteaprogramthatdefinesaclasscalledCirclethatincludesradius(typedouble)asdatamembers.Provideasetandagetfunctionforthisdatamember.Ensurethatthevalueenteredbytheuserisvalidandcorrect(greaterthanzero).Includefunctionmembers:a.functionmemberthatcomputeandretu

c++ - 使用 Visual Studio Compiler 分析内联 C++ 函数

当编译器内联了很多代码时,如何理解Windows上的C++分析数据?IE。我当然想测量实际运行的代码,所以根据定义,我将测量代码的优化构建。但似乎我尝试的所有工具都没有真正设法解决内联函数。我已经尝试了VisualStudio2017Professional和VTune2018中的采样分析器。我尝试启用/Zo,但似乎没有任何影响。我发现以下资源似乎表明只有VisualStudioUltimate或Premium支持内联框架信息-VisualStudio2017是否仍然如此?https://social.msdn.microsoft.com/Forums/en-US/9df15363-5

c++ - 为什么此代码链接到 Intel Compiler 2015 而不是 Intel Compiler 2018?

我的团队最近从2015年英特尔编译器(并行工作室)升级到2018年版本,我们遇到了一个链接器问题,让每个人都焦头烂额。我有以下类(为简洁起见进行了适度编辑),用于处理子进程的包装以及与它们对话的相关文件描述符:classSubprocWrapper{public:staticconstintPASSTHRU_FD=0;staticconstintMAKE_PIPE=-1;typedefstd::mapEnvMapType;staticEnvMapTypegetMyEnv();SubprocWrapper(intstdin_fd_req,intstdout_fd_req,intstder

c++ - 运算符转换、GCC 和 clang : which compiler is right?

考虑以下代码:structS{usingT=int;operatorT(){return42;}};intmain(){Ss;S::Tt=s;//Isthefollowinglinecorrect?t=s.operatorT();}使用GCC(4.9/5.1/6.1)编译,但使用clang(3.8/3.7)编译失败。返回的错误是:error:unknowntypename'T';didyoumean'S::T'?在这种情况下哪个编译器是正确的,为什么?注意解决它是一个合格的问题T:t=s.operatorS::T();问题不在于如何让它发挥作用。 最佳答案

c++ - 我应该使用 std::default_random_engine 还是应该使用 std::mt19937?

当我想使用std::random生成随机数时,我应该更喜欢哪个引擎?std::default_random_engine还是std::mt19937?有什么区别? 最佳答案 对于轻量级随机数(例如游戏),您当然可以考虑default_random_engine.但是,如果您的代码严重依赖于随机性的质量(例如模拟软件),则不应使用它,因为它只提供极简保证:Itisthelibraryimplemention'sselectionofageneratorthatprovidesatleastacceptableenginebehavio

c++ - Visual C++ 中的 "No appropriate default constructor available"错误

我不明白。我一直盯着代码看代码三个小时,我看不出问题。我正在创建的名为TwoDayPackage的类派生自一个名为Package的类。这就是我定义构造函数的方式:TwoDayPackage(string,string,string,string,int,string,string,string,string,int,float,float,float);这是我实现构造函数的方式:TwoDayPackage::TwoDayPackage(stringsName,stringsAddress,stringsState,stringsCountry,intsZIP,stringrName,s

c++ - 自动矢量化 : Convincing the compiler that alias check is not necessary

我正在做一些图像处理,为此我受益于矢量化。我有一个可以矢量化的函数,但是我无法让编译器相信输入和输出缓冲区没有重叠,因此不需要进行别名检查。我应该可以使用__restrict__来做到这一点,但是如果缓冲区在作为函数参数到达时未定义为__restrict__,则无法让编译器相信我是绝对确定2个缓冲区永远不会重叠。这是函数:__attribute__((optimize("tree-vectorize","tree-vectorizer-verbose=6")))voidthreshold(constcv::Mat&inputRoi,cv::Mat&outputRoi,constunsi