草庐IT

files-from

全部标签

c++ - 异常 : bad_weak_ptr while shared_from_this

当我这样做时出现异常:std::bad_weak_ptr->shared_from_this()templateclasspainter_record_t{.......private:std::shared_ptr_owner;}这里我想在构造函数中设置“问题”对象:templateclassstream_record_t:publicpainter_record_t{public:stream_record_t(std::shared_ptrowner):painter_record_t(owner){//...}}我有基类:classi_painter_t{public:virt

c++ - 对 `boost::iostreams::mapped_file_source::mapped_file_source()' 的 undefined reference

我正在测试boost的内存映射文件,但是一旦我声明了一个boost::iostreams::mapped_file,就像在这个程序中一样:#include//definesff_pipelineandff_Pipe#include#include#include#include#include#include#include#include"MapReduceJob.hpp"usingnamespaceff;intmain(intargc,char*argv[]){boost::iostreams::mapped_filemf;}使用这个makefile:#FastflowandBoo

c++ - 我可以跨 DLL 边界传递 FILE 对象吗?

我有一个C++框架,其中一些计算被委托(delegate)给(有时是自动生成的)C函数或具有外部“C”链接的C++函数。这些是低级例程,必须以极快的速度和最小的开销进行评估,它们通常驻留在单独的共享对象/DLL中。他们目前的签名是这样的:intmy_generated_function(constdouble*input,double*output,double*work);它将驻留在共享库中,在POSIX上使用dlopen或在Windows上使用LoadLibrary加载。在POSIX上使用dlsym(handle,"my_generated_function")或在Windows上

c++ - Derived from two Bases - 删除 vector **奇怪**问题

这个问题在这里已经有了答案:Whentousevirtualdestructors?(20个答案)关闭4年前。我花了几个小时试图找出问题出在哪里,但它看起来很奇怪。我以更容易理解的方式重写了我的问题。当它到达它说删除的行时,调试程序会创建一个断点。附言。有趣的是,如果我们采用intb1并将其移动到Base2,它就可以工作。基数1:#pragmaonceclassBase1{public:Base1();~Base1();intb1;};Base2.h:#pragmaonce#include#includeclassDerived;classBase2{public:Base2();~B

c++ - IShellLink::SetIconLocation 将我的图标路径转换为错误的 %Program Files%

有谁知道如何纠正这种行为?目前,当我们的安装程序安装我们的应用程序时,它会获取一个IShellLink,然后使用我们的快捷方式图标(在开始菜单和桌面中)所需的数据加载它,然后使用IPersistFile::Save写出快捷方式。问题是通过IShellLink::SetIconLocation为图标指定的路径被转换为使用%ProgramFiles%...这...对于x64,是错误的。我注意到许多其他32位软件在x64下都存在此问题-但后来我假设他们自己使用%ProgamFiles%作为其.lnk创建代码中的文字元素.但是,似乎是IShellLink迫使这个错误存在,而我没有解决方法(或者

c++ - (makefile 错误)RTNETLINK 回答 : File exists

这是我的生成文件:delay:tcqdiscadddeveth0rootnetemdelay0mstest4_s_delay:delay./a.out10101231120|teeserver_delay.txt但是,我在执行makefile时遇到以下错误:root@superwii-laptop:/home/superwii/Desktop/Amogh#maketest4_s_delaytcqdiscadddeveth0rootnetemdelay0msRTNETLINKanswers:Fileexistsmake:***[delay]Error2我无法克服这个错误。请帮忙。

c++ - 制作 : No rule to make a header file?

我正在尝试使用名为BigInt的库创建一个项目。我的文件结构是:/Users/wen/Projects/challenge/fibonacci3/fibonacci3.cpp/Users/wen/Projects/challenge/fibonacci3/Makefile/Users/wen/Projects/include/bigint//Users/wen/Projects/include/bigint/MakefileFibonacci3Makefile截至LD_FLAGS=CC_FLAGS=#Includelibrariesinclude/Users/wen/Projects/

c++ - Visual Studio 2010 : "ConfigurationGeneral" rule is missing from the project

我想使用VisualC++2010Professional编译一个64位应用程序,但我一直收到这个错误,我不知道该怎么做:1>------Buildstarted:Project:Test,Configuration:Debugx64------1>Error:The"ConfigurationGeneral"ruleismissingfromtheproject.我在谷歌上搜索过这个问题,但所有的想法都没有解决我的问题。谢谢!如果需要这些信息,我有windows8.1Pro64bits,我使用的是visualstudio2010c++professional。编辑:尝试修复visua

c++ - 为什么 std::shared_ptr 的别名构造函数不初始化 std::enabled_shared_from_this?

考虑以下代码:structFoo:std::enable_shared_from_this{};structBar{Foofoo;};intmain(){std::shared_ptrbar_p(newBar);//makeshared_ptrtomemberwithaliasingconstructorstd::shared_ptrfoo_p(bar_p,&bar_p->foo);assert(bar_p->foo.shared_from_this());//fail!throwsbad_weak_ptr}不幸的是,它没有按预期工作(至少在GCC4.8.2中)。我查看了代码,似乎别名

C++ 系统不使用 "source files"

在C++编程语言(第4版)§15.1中,Stroustrup指出:Afileisthetraditionalunitofstorage(inafilesystem)andthetraditionalunitofcompilation.Therearesystemsthatdonotstore,compile,andpresentC++programstotheprogrammerassetsoffiles.遗憾的是,他没有提供更多信息。您知道此类系统的任何示例吗?编辑:我的意思是,如果您知道任何实际免费、商业、开源或其他C++实现,它们不会像我们习惯的那样处理文件。我想知道:为什么会有