- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在将一个大型 VC++ 6.0 应用程序转换为 VS2010,并且在其中一个项目中一直遇到此错误:
error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\ios(176) : see declaration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> This diagnostic occurred in the compiler generated function 'std::basic_ofstream<_Elem,_Traits>::basic_ofstream(const std::basic_ofstream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
根据错误文本和此处提出的类似问题,我假设错误是由 ofstream
的实例直接传递到函数而不是通过引用传递引起的。
我遇到的问题是,要找到以错误方式传递 ofstream
的代码行。错误消息仅链接到 VS2010 中包含的 fstream header ,而我的项目在数万行代码的代码库中到处使用 ofstream
(没有我写的代码)。
我会非常感谢任何帮助/提示/策略来定位此类编译器错误。您将如何解决定位此类错误的问题?
最佳答案
How would you approach the problem of locating this kind of error?
在源文件中执行 grep
(正则表达式搜索)
\(([^,]+,)*, (std::)?of?stream [^&]
关于c++ - : error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 的错误搜索技巧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8987459/
new _Elem[_Size]() 与 new _Elem[_Size]{} 之间有什么区别,我应该更喜欢哪种形式? 如果您知道所讨论的元素并且未在模板参数中使用它,这会有什么不同吗? 这个问题假设
以前有人遇到过这个错误吗?我不知道究竟是什么导致了这种情况: 1>...include\sstream(640): error : "std::basic_ios::basic_ios(const s
这是我的第一篇文章。 我看了很多题目,似乎我做的还不错,但是当我尝试编译下面的代码时,我又遇到了上面的错误: // Header file #include #include #include
我无法理解这个错误。这个错误不在我正在调试的类中。 (是吗?)错误是: c:\program files\microsoft visual studio 10.0\vc\include\fstream
收到此错误,我很确定它在 operator::basic_ios' : cannot access private member declared in class 'std::basic_ios'
我需要将项目从 VS2003 转换到 VS2008。在以下代码中: wchar_t wpom[30]; mbtowc(wpom, "olaboga", 10); ati_dom::DOMString
我整个星期都在做这个家庭作业。就在程序最终运行时,我意识到仅使用 cin >> breed,如果我的输入有空格,它会破坏代码(因为我的程序需要收集 3 个单独的变量,首先是int,然后是字符串,最后是
我正在尝试使用 Microsoft 特定 filebuf::sh_none打开 fstream 的变量在独占模式(另一个 Microsoft 特定功能)。我收到上述错误。我正在进口 .我该如何解决这
我使用 fstream 打开文件进行写入。 fstream streamFile; streamFile.open ( "C:\\path\\to\\textFile.txt", fstream::
嘿,我收到一个错误,我认为这与从阅读其他帖子中复制 ofstream 变量有关,我已经尝试更改 std::ofstream outfil; 到 std::ofstream & outfil; 但是我得
嘿,我收到一个错误,我认为这与从阅读其他帖子中复制 ofstream 变量有关,我已经尝试更改 std::ofstream outfil; 到 std::ofstream & outfil; 但是我得
这个特定方法有问题,不知道如何解决!我得到的错误是上面的: "error C2248: 'std::basic_ios::basic_ios' : cannot access private memb
我在 MS visual studio 2005 的 Windows 上运行 Openipmp 客户端。尽管根据文档,它仅在 visual studio 6 和 MS visual studio .N
不幸的是,我的任务是编译一个旧的 C++ DLL,以便它可以在 Win 7 64 位机器上运行。我的 C++ 经验为零。我已经解决了其他问题,但是这个问题难倒了我,我还没有在其他地方找到解决方案。以下
在创建一个简单的异常类扩展(我可以在其中更轻松地构建错误消息)时,我将错误隔离为以下简单代码: #include #include class myCout { public: std::
给定以下代码, #include #include template void func() { std::basic_stringstream outStream; D suf
我似乎无法发现这里的错误,其他文章对错误的答案有点模糊所以这里是我的。我收到此错误,我相信它与它试图打开的文件有关。我发布了整个 .cpp 文件,因为我不确定错误的来源。 #include #inc
我在下面的代码中 str.append(ch); 行遇到了 abpve 错误。 我基本上想为每个 char 'ch' 附加 str。 如果有人知道这个问题,请更正我的错误。 int extract(u
我问这个问题是因为我有点无助:这个错误只发生在 Visual Studio 中,GCC 编译它没有错误甚至没有警告。由于这是一些可移植代码,我正在寻找一种适用于两种编译器的解决方案(最好的情况是不依赖
我正在将一个大型 VC++ 6.0 应用程序转换为 VS2010,并且在其中一个项目中一直遇到此错误: error C2248: 'std::basic_ios::basic_ios' : canno
我是一名优秀的程序员,十分优秀!