Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upgrading Visual C++ 6.0 to Visual Studio 2005

Status
Not open for further replies.

cthforums

Programmer
Aug 10, 2006
2
US
I have inherited some code that was built in Visual Studio 6.0. I am trying to build it in Visual Studio 2005. I referenced the white paper provided on the MSDN website about upgrading. However now, I am getting just one error in my code that is little weird. I find it hard to beleive that no one else has run into this. The code I am trying to build opens up a file and scans it to create a hex image based on the delimited data that is to be programmed to an EEProm. I am not getting an error in the code but in the standard C++ library that comes with Visual Studio. Please take a look. Any help is greatly appreciated.


2>c:\program files\microsoft visual studio 8\vc\include\fstream(675) : error C2248: 'std::basic_ios<_Elem,_Traits>::basic_ios' : cannot access private member declared in class 'std::basic_ios<_Elem,_Traits>'
2> with
2> [
2> _Elem=char,
2> _Traits=std::char_traits<char>
2> ]
2> c:\program files\microsoft visual studio 8\vc\include\ios(151) : see declaration of 'std::basic_ios<_Elem,_Traits>::basic_ios'
2> with
2> [
2> _Elem=char,
2> _Traits=std::char_traits<char>
2> ]
2> This diagnostic occurred in the compiler generated function 'std::basic_ifstream<_Elem,_Traits>::basic_ifstream(const std::basic_ifstream<_Elem,_Traits> &)'
2> with
2> [
2> _Elem=char,
2> _Traits=std::char_traits<char>
2> ]

Thanks,
CH
 
Does the code use <fstream> or <fstream.h>. Might possibly be
using .h files instead of the non-extension ones
 
It looks like your code is trying to make a copy of an fstream. You are not allowed to copy an fstream. Maybe you just need to make a function take the fstream by reference instead of by value. There's no way to know how to fix it without the code.

Look for any places you copy an fstream variable or pass it by value to a class or function.
 
My hunch was that it was that the fstream was being passed by value too. I have not gone through all of the code yet, and I do not want to post it because it is company confidential. But Ill let you know what I find today. Thanks for the help.

Cheers,
CH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top