草庐IT

non-open

全部标签

c++ - 使用 ALSA 库的音频捕获 - snd_pcm_open => No such file or directory

我正在尝试使用ALSA库在SoC上实现音频捕获。我有一个预编译的libasound.so.2.0.0和一个asoundlib.h以及其他header。现在我有intreturnCode;snd_pcm_t*pcm_Handle;char*pcm_device_name="hw:0,0";returnCode=snd_pcm_open(&pcm_Handle,pcm_device_name,SND_PCM_STREAM_CAPTURE,0);返回snd_strerror(returnCode)的Nosuchfileordirectory这是否表示捕获设备未正确安装(例如驱动程序或其他东西

c++ - C++ 标准中的什么措辞允许 static_cast<non-void-type*>(malloc(N));去工作?

据我了解5.2.9静态转换中的措辞,void*-to-object-pointer转换的结果唯一允许的时间是void*首先是反向转换的结果。在整个标准中有一堆对指针表示的引用,void指针的表示与char指针的表示相同,等等,但它似乎从来没有明确地说转换任意void指针会产生指向内存中相同位置的指针,具有不同的类型,就像类型双关未定义而不是双关一样对象的实际类型。因此,虽然malloc清楚地返回了合适内存的地址等,但据我所知,似乎没有任何方法可以移植地实际使用它。 最佳答案 C++0x标准草案在5.2.9/13中有:Anrvalue

c++ - Visual Studio 2015 "non-standard syntax; use ' &' to create a pointer to member"

我正在尝试用C++实现自己的链表,但终究无法弄清楚为什么会出现此错误。我知道有一个STL实现,但出于某种原因,我正在尝试自己的实现。这是代码:#includetemplateclassListElement{public:ListElement(constT&value):next(NULL),data(value){}~ListElement(){}ListElement*getNext(){returnnext;}constT&value()const{returnvalue;}voidsetNext(ListElement*elem){next=elem;}voidsetValu

c++ - 线程错误 : invalid use of non-static member function

这个问题在这里已经有了答案:Passingmemberfunctionstostd::thread[duplicate](2个答案)关闭5年前。我想了解C++中的线程,但我不知道如何解决这个问题。我想调用两个线程来运行名为“createS”的函数,但出现此错误:error:invaliduseofnon-staticmemberfunction我读过关于这个主题的其他问题,但我真的不明白如何让我的代码工作。有人可以向我解释我做错了什么并尝试帮助我找到解决方案吗?test_class.cppvoidtest_class::generateS(){map1=newmultimap>;map

c++ - ifstream::open 在 Visual Studio Debug模式下不工作

我已经遍历了SO上的ifstream问题,但我仍然无法阅读简单的文本文件。我正在使用VisualStudio2008。这是我的代码://CPPFileIO.cpp:Definestheentrypointfortheconsoleapplication.//#include"stdafx.h"#include#include#include#includeusingnamespacestd;int_tmain(intargc,_TCHAR*argv[]){ifstreaminfile;infile.open("input.txt",ifstream::in);if(infile.is_

c++ - fatal error LNK1104 : cannot open file 'libboost_regex-vc90-mt-gd-1_42.lib'

我正在尝试在我的程序中使用boost正则表达式问题是我得到这个错误......我所做的唯一安装步骤是添加:“C:\ProgramFiles\boost\boost_1_42”进入附加包含目录...我正在使用VS2008...尝试实现这个:#include#include#includeusingnamespacestd;intmain(){std::strings,sre;boost::regexre;boost::cmatchmatches;while(true){cout>sre;if(sre=="quit"){break;}cout>s;try{//Assignmentandco

详细解决-error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such

文章目录前言总结前言今天在Centos系统运行我的xray,发现报了这个错./xray:errorwhileloadingsharedlibraries:libpcap.so.0.8:cannotopensharedobjectfile:Nosuchfileordirectory也有一些小坑,特地记录一下,方便自己日后查看。提示:以下是本篇文章正文内容,下面方法成功解决首先正常给了执行权限,chmod777或者755都行。然后运行发现报错了。先直接yum安装libpcap-devel:yuminstalllibpcap-devel然后locate命令去查看,定位出/usr/lib64目录下的三

c++ - Open-CV - 加载不正确

我正在使用Ubuntu14.04并尝试编译此代码,但无论如何我都会遇到这些错误,我相信这与包含OpenCV库有关,但我不确定。谁能帮帮我?错误:main.cc:66:37:error:‘CV_RETR_EXTERNAL’wasnotdeclaredinthisscopemain.cc:66:55:error:‘CV_CHAIN_APPROX_NONE’wasnotdeclaredinthisscopemain.cc:81:28:error:‘CV_BGR2GRAY’wasnotdeclaredinthisscope代码(抱歉格式问题,我就是没弄对):#include#include#i

c++ - cpp :-1: error: C1041: cannot open program database; untitled-build-desktop-debug\vc120. pdb'

此问题的所有可用答案都是VisualStudio的解决方案。我在QT中面临这个问题。我运行了一个示例示例,但弹出此错误。有人可以帮忙吗。错误:C1041:无法打开程序数据库“c:\users\newfolder\untitled-build-desktop-debug\vc120.pdb”;如果多个CL.EXE写入同一个.PDB文件,请使用/FS 最佳答案 右击项目->属性->c/c++->输出文件:在程序数据库文件名中:包括项目名称和路径。(.../../../../release/ProjectName/)这种方法对我有用。

c++ - (Re)Using std::algorithms with non-standard containers

我有一个“列”容器类型:structMyColumnType{//Data:Eachrowrepresentsamemberofanobject.vectora;//Allvectorsareguaranteedtohavealwaysvectorb;//thesamelength.vectorc;voidcopy(intfrom_pos,intto_pos);//Thecolumntypeprovidesaninterfacevoidswap(intpos_a,intpos_b);//forcopying,swapping,...voidpush_back();//Andforres