Including <vector> in VC6 project - compile errors

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi there,

I have a VC6 project to which I would like to use the std::vector
class. When I include it i get a bunch of compile errors which are
highlighted in the <new> header. These are as follows:

--------------------Configuration: vc_rars - Win32
Debug--------------------
Compiling...
drivers.cpp
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(36) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(37) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(37) : error
C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const
struct std::nothrow_t &)' : overloaded function differs only by return
type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) :
see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(41) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void
*)' : overloaded function differs only by return type from 'void
*(__cdecl *__cdecl operator new(void))(unsig
ned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) :
see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2065: '_P' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\memory(16) :
error C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned
int,class std::allocator<`template-parameter257'> &)' : could not
deduce template argument for 'void *(__cdecl *)(u
nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl
*)(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned
int,class std::allocator<`template-parameter257'> &)' and 'void
*(__cdecl *__cdecl operator new(void))(unsigned int
)' have different return types
c:\program files\microsoft visual
studio\vc98\include\memory(16) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\memory(20) :
error C2954: template definitions cannot nest
d:\source\rars\rars\list.h(106) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver **
' (ie; not a UDT or reference to a UDT. Will produce errors if applied
using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
d:\source\rars\rars\list.h(107) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver
*const * ' (ie; not a UDT or reference to a UDT. Will produce errors
if applied using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
race_manager.cpp
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error
C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(36) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(37) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(37) : error
C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const
struct std::nothrow_t &)' : overloaded function differs only by return
type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) :
see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(41) : error
C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void
*)' : overloaded function differs only by return type from 'void
*(__cdecl *__cdecl operator new(void))(unsig
ned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) :
see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(42) : error
C2065: '_P' : undeclared identifier
c:\program files\microsoft visual studio\vc98\include\memory(16) :
error C2059: syntax error : 'string'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2784: 'void *(__cdecl *__cdecl operator new(void))(unsigned
int,class std::allocator<`template-parameter257'> &)' : could not
deduce template argument for 'void *(__cdecl *)(u
nsigned int,class std::allocator<_Ty> &)' from 'void *(__cdecl
*)(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2785: 'void *(__cdecl *__cdecl operator new(void))(unsigned
int,class std::allocator<`template-parameter257'> &)' and 'void
*(__cdecl *__cdecl operator new(void))(unsigned int
)' have different return types
c:\program files\microsoft visual
studio\vc98\include\memory(16) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\memory(17) :
error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\memory(20) :
error C2954: template definitions cannot nest
d:\source\rars\rars\list.h(106) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver **
' (ie; not a UDT or reference to a UDT. Will produce errors if applied
using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
d:\source\rars\rars\list.h(107) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver
*const * ' (ie; not a UDT or reference to a UDT. Will produce errors
if applied using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
ga_driver_pop.cpp
d:\source\rars\rars\list.h(106) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver **
' (ie; not a UDT or reference to a UDT. Will produce errors if applied
using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
d:\source\rars\rars\list.h(107) : warning C4284: return type for
'List<class GA_Driver *>::iterator::operator ->' is 'class GA_Driver
*const * ' (ie; not a UDT or reference to a UDT. Will produce errors
if applied using infix notation)
d:\source\rars\rars\ga_driver_pop.h(41) : see reference to
class template instantiation 'List<class GA_Driver *>' being compiled
Error executing cl.exe.
Creating browse info file...

vc6_rars.exe - 34 error(s), 6 warning(s)

Any ideas?

Thanks,
Caroline

.



Relevant Pages

  • Re: CLR plug in algorithm
    ... When doing data mining on top of a string attribute, ... The assumption is that, for discrete attributes, a data mining algorithm ... using a reference to your UDT DLL you might be able to deserialize the ...
    (microsoft.public.sqlserver.datamining)
  • Re: RecLength for Random File
    ... where the UDT is to ... never read the record back in since it wouldn't know the end of one string ... To save a record to disk, VB's Random Access file I/O is used. ... Dim hFile as Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Storing variables with Random Files
    ... Dim Store1 As String * 15 ... UDT works well for that purpose. ... relational database that has only ONE table (which would mean it's ...
    (microsoft.public.vb.general.discussion)
  • Re: What tool should I use ? More info
    ... My only suggestion is that the UDT should be wrapped inside a class. ... MMSI As String ... Every time I receive info from a specific ship, her info or some of her info is changed. ... best sorting tool for multiple sorting ...
    (microsoft.public.vb.general.discussion)
  • Re: UDT to Strings via CopyMemory. How?
    ... Your UDT is not being ... > Now I try to use Byte array instead of string as a media. ... > Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ... > Dim udt1 As udtTest, ...
    (microsoft.public.vb.winapi)