compile error msg

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am getting the following error message during compilation of my C++ program on XP laptop using .NET libraries:

ossxerces_utils.cxx
C:\narayan\axcelis\Lib\ossxerces_utils\src\OssDataFileTemplate.cxx(122) : error
C2582: 'operator =' function is unavailable in 'std::basic_ofstream<_Elem,_Trait
s>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\narayan\axcelis\Lib\ossxerces_utils\src\OssDataFileTemplate.cxx(304) : error
C2440: 'return' : cannot convert from 'std::_Ptrit<_Ty,_Diff,_Pointer,_Reference
,_Pointer2,_Reference2>::_Myt' to 'OssDataTag *'
with
[
_Ty=std::vector<OssDataTag,std::allocator<OssDataTag>>::value_type,
_Diff=std::vector<OssDataTag,std::allocator<OssDataTag>>::difference
_type,
_Pointer=std::vector<OssDataTag,std::allocator<OssDataTag>>::_Tptr,
_Reference=std::vector<OssDataTag,std::allocator<OssDataTag>>::refer
ence,
_Pointer2=std::vector<OssDataTag,std::allocator<OssDataTag>>::_Tptr,

_Reference2=std::vector<OssDataTag,std::allocator<OssDataTag>>::refe
rence
]
No user-defined-conversion operator available that can perform this conv
ersion, or the operator cannot be called
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

"ANY HELP HIGHLY APPRECIATED"
 
mn04 said:
I am getting the following error message during compilation of my C++
program on XP laptop using .NET libraries:
ossxerces_utils.cxx
C:\narayan\axcelis\Lib\ossxerces_utils\src\OssDataFileTemplate.cxx(122) : error
C2582: 'operator =' function is unavailable in 'std::basic_ofstream<_Elem,_Trait
s>'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]

You can't assign to objects of type basic_ofstream. The copy-assignment
operator
cannot be generated because members or bases are not copy-assignable.

What are you trying to do?
C:\narayan\axcelis\Lib\ossxerces_utils\src\OssDataFileTemplate.cxx(304) : error
C2440: 'return' : cannot convert from 'std::_Ptrit<_Ty,_Diff,_Pointer,_Reference
,_Pointer2,_Reference2>::_Myt' to 'OssDataTag *'
with
[
_Ty=std::vector said:
]
No user-defined-conversion operator available that can perform this conv
ersion, or the operator cannot be called
Iterators are modelled after pointers. But they need not be pointers. VC 6
uses
pointer types for vector iterators. In VC7+ there are distinct types for
iterators.

You should probably use a std::vector<OssDataTag>::iterator or
std::vector<OssDataTag>::const_iterator. If you really want to obtain a
pointer
from an iterator you can still use &*iter. E.g.

std::vector<int> v;
std::vector<int>::iterator i = v.begin(); // OK
int* p = &*v.begin(); // OK

-hg
 
Back
Top