草庐IT

c++ - 从 C++ 调用 C 函数, "no matching function"错误

我已经定义了以下头文件(在C中),省略了函数实现,因为不需要这个:#ifndefFFMPEG_MEDIAMETADATARETRIEVER_H_#defineFFMPEG_MEDIAMETADATARETRIEVER_H_#include#include#includeintsetDataSource(AVFormatContext**pFormatCtx,constchar*path);#endif/*FFMPEG_MEDIAMETADATARETRIEVER_H_*/在C++中,我定义了第二个头文件:#ifndefMEDIAMETADATARETRIEVER_H#defineMED

c++ - 模板特化 : does not match any template declaration

我在学习模板特化的时候,用了一个很简单的例子,但是还是报错。#includetemplateclasschrrr{public:Tchgchr(Tc);};templateTchrrr::chgchr(Tc){returnc+1;}templateclasschrrr{public:charchgchr(charc);};templatecharchrrr::chgchr(charc){returnc+2;}usingnamespacestd;intmain(){chara='a';inti=1;chrrrit;chrrrch;cout错误说:line20:error:template

c++ - 我在以下函数中收到错误 no match for operator >>。怎么了?

voidGetarrayElements(inta[]){intk=0;while(true){cout>a[k]>>endl;if(a[k]=0){k+=1;}else{break;}}}我试图将0到100之间的一些输入值读入一个数组,但我收到了这个错误。“不匹配运算符>>”。有什么问题吗? 最佳答案 endl只能应用于cout等输出流;你不能在cin上使用它。 关于c++-我在以下函数中收到错误nomatchforoperator>>。怎么了?,我们在StackOverflow上找到

c++ - regex_match 有什么问题?很简单的表达

我正在使用VS2010并编写C++控制台应用程序并遇到问题#includeusingnamespacestd;//...if(!regex_match("abab",regex("(ab?)*"))){//theproblemis-whywearehere?whyitdoesn'tmatch?}在这里查看http://regexpal.com/-它匹配 最佳答案 非常简单:regex_match仅在整个序列匹配时才返回true。如果您想查看一个字符串是否包含您的正则表达式,您可能需要使用regex_search。“是吗?”匹配“ab

c++ - "error: no matching function for call to"构造未初始化的结构时

我正在尝试使用boost::lockfree::spsc_queue有了这个websocketserver而不是std::queue用于m_actions以包含此struct:enumaction_type{SUBSCRIBE,UNSUBSCRIBE,MESSAGE};structaction{action(action_typet,connection_hdlh):type(t),hdl(h){}action(action_typet,server::message_ptrm):type(t),msg(m){}action_typetype;websocketpp::connecti

c++ - 从基类继承两次时如何修复 "error: no matching function for call to"

我目前正在尝试在我的项目中实现一系列继承类。因此,我使用成员初始值设定项列表并将对变量的引用“管道化”到基类。我真的不确定,为什么我会收到编译器错误。我已经尝试将引用“int&id”更改为指针“int*id”。上面的示例只是指出我的问题的最小示例:classBase{public:int&m_id;Base(int&id):m_id(id){}};classDerived1:virtualpublicBase{public:Derived1(int&id):Base(id){};};classDerived2:publicDerived1{public:Derived2(int&id)

c++ - 模板错误 : no matching function call

我正在通过加速C++工作,遇到了Ex问题。10.2这些问题涉及重写上一章的中值函数,以便现在可以使用vector或内置数组调用中值。中值函数还应该允许任何算术类型的容器。我无法对下面详述的median进行两次调用-我收到了错误消息Nomatchingfunctionforcallto'median'我从一些研究中了解到,当使用模板时,应该在编译时知道类型。这可能是根本问题吗?有没有办法以某种方式将Type作为模板参数传递?到目前为止,这是我的代码:#include#include#include#include#includeusingnamespacestd;templateType

C++ 错误 : no match for call to ‘(std::string {aka std::basic_string<char>}) (std::string&)’

我是C++新手。我搜索了很多次,但仍然得不到答案。我正在写一个名为Course的类(class)来描述学生在学校上的类(class)。Course类有3个字段:protected:stringcourseName;intcourseNum;floatscore;我有一个公共(public)方法“setName”来设置类(class)名称:Course&setName(stringname){this->courseName(name);return(*this);}但是,当我尝试编译时,编译器会提示:C++错误:对“(std::string{akastd::basic_string})

ios - 在模拟器上运行时为 "No installed provisioning profiles match the installed iOS signing identities."

阿洛我正在尝试在Xamarin中使用iOS钥匙串(keychain),但出现错误34018。经过一些谷歌搜索后,我添加了Entitlements.plist并将其添加到项目属性中的iOSBundleSigning中的自定义权利,但现在我得到了“没有已安装的配置文件与已安装的iOS签名身份匹配。”错误。我正在尝试在模拟器中运行该应用程序,我认为在模拟器中运行不需要配置文件。为什么添加Entitlements.plist会导致此错误,我该如何解决?谢谢! 最佳答案 使用任何类型的iOS功能(iOS应用程序服务)都需要iOS配置文件,并且

ios - doesNotMatchKey :inQuery: return records that match key in Parse SDK for iOS

我正在尝试使用ParseSDK在xcode中执行一个简单的查询,我正在向用户展示产品,但我不想向他们展示他们已经“喜欢”的产品。所以我在Parse中使用了两个表:-产品:有一个objectId-喜欢:包含列:喜欢(说是/否)、产品指针、用户指针我的代码是://querywillgetproductsthattheuserhaslikedPFQuery*likeQuery=[PFQueryqueryWithClassName:@"Likes"];[likeQuerywhereKey:@"User_Obj"equalTo:[PFUsercurrentUser]];//productquer