草庐IT

create-ignore

全部标签

c++ - 如何摆脱 "C++ exception specification ignored"警告

最近得到一个别人实现过的dll。我必须在我的应用程序中使用它。在他们类的头文件中,他们有函数声明voidfunc1()throw(CCustomException);现在当我编译它时收到警告,C++exceptionspecificationignoredexcepttoindicateafunctionisnot_declspec(nothrow)我读了MSDN-Documentation但无法清楚地理解它。另外,我不想仅仅因为它出现就禁用警告。我想知道我做错了什么而不是禁用它。我想我的函数,说myfunc()从dll访问那个func1()没有那个异常规范列表。因此,我也尝试在我的函

c++ - CreateProcess( ) 不创建带有 CREATE_NEW_CONSOLE 标志的新窗口 - C/C++

当然,我一直在尝试使用WindowsAPI使用CreateProcess()创建进程。由于某种原因,即使在搜索网络之后,我也无法创建新的控制台。我做过的研究:我使用MSDN示例代码作为我应该在函数中使用的参数的基础:http://msdn.microsoft.com/en-us/library/windows/desktop/ms682512%28v=vs.85%29.aspx我阅读了以下MSDN文章,了解有关如何创建新控制台窗口的信息:http://msdn.microsoft.com/en-us/library/windows/desktop/ms682528%28v=vs.85%

c++ - 清除cin input : is cin. ignore不是好办法吗?

什么是清除cin输入的更好方法?我认为cin.clear和cin.ignore是个好方法?代码:voidclearInput(){cin.clear();cin.ignore(1000,'\n');//cin.ignore(std::numeric_limits::max(),'\n');}我的老师给了我这个回复:thisisbasicallysayingthatyourclearInputdoesn'tworkFYI:ignoreisNEVERagoodideaasawayofgettingridofallthatremainsonalineandyourfailingthistes

c++ - Visual Studio 2012 : C++ compiler ignoring user-specified include directories

我遇到常见错误fatalerrorC1083:Cannotopenincludefile:'afxres.h':Nosuchfileordirectory。搜索引擎为此显示了很多匹配项,但没有一个建议的解决方案对我有用。通常这看起来是路径问题。所以,我确保安装了相关的库,并找到了文件。使用绝对路径作为#include工作正常:#include"C:\ProgramFiles(x86)\MicrosoftVisualStudio11.0\VC\atlmfc\include\afxres.h"但是,如果我将目录(C:\ProgramFiles(x86)\MicrosoftVisualStu

c++ - 为什么 std::ios_base::ignore() 设置 EOF 位?

当我从一个流中读取所有数据,但没有尝试读取到它的末尾时,流的EOF没有设置。这就是C++流的工作方式,对吧?这就是它起作用的原因:#include#includecharbuf[255];intmain(){std::stringstreamss("abcdef");ss.read(buf,6);assert(!ss.eof());assert(ss.tellg()==6);}但是,如果我ignore()而不是read()ing数据,EOF被设置:#include#includeintmain(){std::stringstreamss("abcdef");ss.ignore(6);a

c++ - 关于 RAII : How to prevent errors caused by accidentally creating a temporary?

有一段时间,一位同事告诉我他花了很多时间调试竞争条件。罪魁祸首原来是这样的:voidfoo(){ScopedLock(this->mutex);//Oops,shouldhavebeenanamedobject.//Edit:addedthe"this->"tofixcompilationissue.//....}为了防止这种情况再次发生,他在ScopedLock类的定义之后创建了以下宏:#defineScopedLock(...)Error_You_should_create_a_named_object;这个补丁工作正常。有没有人知道任何其他有趣的技术来防止这个问题?

Android 最全Ignore文件 : 解决部分不必要文件上传到Git的问题

1.背景我们新建一个Android项目,默认会生成一个.ignore文件*.iml.gradle/local.properties/.idea/caches/.idea/libraries/.idea/modules.xml/.idea/workspace.xml/.idea/navEditor.xml/.idea/assetWizardSettings.xml.DS_Store/build/captures.externalNativeBuild.cxxlocal.properties但是,我们如果平时使用的时候会发现,这个.ignore文件是不全的,还是会有部分不必要的文件被上传到git上

c++ - 理解错误 "terminate called after throwing an instance of ' std::length_error' what(): basic_string::_S_create Aborted (core dumped)"

所以这是我的错误:terminatecalledafterthrowinganinstanceof'std::length_error'what():basic_string::_S_createAborted(coredumped)这是我的代码://CoderemovedstringgenerateSong(stringlist[],intnum){//Coderemoved//Coderemovedfor(i=0;i我只想知道该错误的含义,以便我知道如何修复它。我看到很多帖子都有类似的错误,但没有完全相同的。从字面上看,我才刚刚开始使用C++,而这些答案对我目前所学的知识都没有任何

c++ - 未定义对 `pthread_key_create' 的引用(链接器错误)

我已经从这里下载了gtest1.7.0源代码:https://code.google.com/p/googletest/downloads/list并在ubuntu13.10上构建gtest.a文件(lib文件):Linuxubuntu3.11.0-15-generic#23-UbuntuSMPMonDec918:17:04UTC2013x86_64x86_64x86_64GNU/Linux生成的库称为:libgtest.a。在我的main.cpp文件中有:#include#include"gtest/gtest.h"intmain(){std::cout从我构建的终端:g++main

c# - 如何: Create a Key In the Registry (Visual C#)?

我正在使用C#在.NET框架中开发Windows应用程序。在安装应用程序时,我想将某个值写入注册表。 最佳答案 Microsoft.Win32.RegistryKeykey;key=Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Names");key.SetValue("Name","Isabella");key.Close();http://msdn.microsoft.com/en-us/library/microsoft.win32.registry.aspx