草庐IT

no-match

全部标签

c++ - G++ 4.5 错误 : No diagnostic for narrowing in initializer list

我尝试了以下代码:intmain(){intx{23.22};}其中包括需要缩小的初始化,但代码编译正常,没有任何错误或警告。另一方面,以下代码给出了错误:intmain(){intx[]{23.22};}我是发现了错误还是什么?PS:我目前使用的是GCC4.5.0 最佳答案 看起来像一个错误。以下直接来自n3092草案:8.5.4List-initialization—Otherwise,iftheinitializerlisthasasingleelement,theobjectisinitializedfromthatelem

c++ - 错误 C2678 : binary '=' : no operator found which takes a left-hand operand of type 'const Recipe' (or there is no acceptable conversion)

我正在尝试对每个元素中包含一个int和一个字符串的vector进行排序。它是一个称为vector食谱的类类型的vector。出现上述错误,这是我的代码:在我的Recipe.h文件中structRecipe{public:stringget_cname()const{returnchef_name;}private:intrecipe_id;stringchef_name;在我的Menu.cpp文件中voidMenu::show()const{sort(recipes.begin(),recipes.end(),Sort_by_cname());}在我的Menu.h文件中#include

c++ - CRTP + 特征类 : "no type named..."

我尝试使用模板化类实现CRTP,但在使用以下示例代码时出现错误:#includetemplateclassTraits{public:typedeftypenameT::typetype;//'staticconstunsignedintm_const=T::m_const;staticconstunsignedintn_const=T::n_const;staticconstunsignedintsize_const=T::m_const*T::n_const;};templateclassCrtp{public:typedeftypenameTraits::typecrtp_typ

如何彻底禁用笔记本电脑的键盘或者禁用笔记本的触控屏,及禁用后如何恢复,解决笔记本电脑蓝屏信息显示:“systern thread exception no handled” 失败操作“etd.sys

目录测试键盘是否失灵的软件针对场景网上教的方法——卸载掉PC/AT增强型PS/2键盘(101/102键)具体做法我推荐的做法——禁用笔记本的PC/AT增强型PS/2键盘(101/102键)禁用笔记本键盘(PC/AT增强型PS/2键盘(101/102键)方法禁用了笔记本键盘后虚拟键盘调用方式恢复笔记本键盘(PC/AT增强型PS/2键盘(101/102键)方法如果在笔记本电脑误操作禁用了HTD驱动导致电脑蓝屏开不了机怎么办(现象)笔记本电脑蓝屏,蓝屏信息显示:“systernthreadexceptionnohandled”或者失败操作“etd.sys”解决办法:在进入不到系统时修改ETD.sys

c++ - Qt - 获取 "warning: format not a string literal and no format arguments"

在这样的行上不断收到警告qDebug("Anerroroccuredwhiletryingtocreatefolder"+workdir.toAscii());workdir是QString()warning:formatnotastringliteralandnoformatarguments 最佳答案 大概应该是:qDebug("Anerroroccuredwhiletryingtocreatefolder%s",workdir.constData());自qDebug将constchar*作为第一个参数。

c++ - STL 中的 VS 编译器错误 C2752 ("more than one partial specialization matches")

不知何故,我喜欢这些显示(基本?)问题的“最短”程序。在VS2008中测试一些模板代码时出现了这个错误(它也已在VS2010和VS2012中得到确认,见下文):c:\programfiles(x86)\microsoftvisualstudio9.0\vc\include\xmemory(225):errorC2752:'std::_Ptr_cat_helper':morethanonepartialspecializationmatchesthetemplateargumentlistwith[_T1=constfloat(**),_T2=constfloat(**)]我可以将问题归

c++ - Opencv 错误 : no GPU support (library is compiled without CUDA support)

我正在尝试使用CUDA在GPU上使用opencv处理一些图像处理任务。我正在使用ubuntu。我毫无问题地设置了我的两个产品Opencv和Cuda,我确信这一点。但是,当我尝试在eclipse中运行sampleCOde时,出现错误:OpenCV错误:在mallocPitch中没有GPU支持(库在没有CUDA支持的情况下编译),文件/home/muad/Source/OpenCV-2.4.2/modules/core/src/gpumat.cpp,第749行我重做了我的opencv,但我还是明白了。 最佳答案 如文档中所述,您必须使用

C++ - 错误 E2285 : Could not find a match for 'tolower(char *)' in function parseInput(fstream &)

给定以下代码:voidparseInput(fstream&inputFile){constintLENGTH=81;charline[LENGTH];while(!inputFile.fail()){inputFile.getline(line,LENGTH);line=tolower(line);cout编译时出现这个错误:ErrorE2285:Couldnotfindamatchfor'tolower(char*)'infunctionparseInput(fstream&)我知道它返回一个int,而不是int[],这是否意味着我不应该使用getline而应该将输入字符转换为字符

c++ - 迭代器模式 - 错误 C2679 : binary '<<' : no operator found which takes a right-hand operand of type 'std::string'

这个问题在这里已经有了答案:errorC2679:binary'(1个回答)关闭5年前。我正在尝试使用迭代器模式进行迭代和打印,但出现错误这里是错误:errorC2679:binary'couldbe'std::basic_ostream&std::operator>(std::basic_ostream&,constchar*)'这是错误的来源std::coutgetName();#ifndef_ROBOT1_#define_ROBOT1_namespaceguitars{namespaceComposite{namespaceInventoryParts{usingnamespac

c++ - Netbeans远程C++开发 "No rule to make target"错误

在Netbeans中创建一个简单的远程C++开发应用程序时,出现以下错误:gmake[2]:Enteringdirectory'/path/to/project'gmake[2]:***Noruletomaketarget'/path/to/project/cpp/file'gmake[2]:Leavingdirectory'/path/to/project'BUILDFAILED(exitvalue2,totaltime:1s)要重现此错误,我只需创建一个新的C/C++项目,选择一个我已经配置的远程主机。当我添加具有相应.h文件的.ccp文件时,出现此错误。我什至不必使用或包含这些文