I'm using Visual Studio 2005 Professional, and I didn't find the
STL.NET. This code:
#include "stdafx.h"
#include <vector>
using namespace System;
using namespace std;
int main(array<Syst em::String ^> ^args)
{
vector<String^> v;
// don't work either
//vector<String^> ^ v = gcnew vector<String^> ();
v.push_back("sd fsdfsd");
return 0;
}
just gives me this:
------ Build started: Project: cppcli1, Configuration: Debug Win32
------
Compiling...
cppcli1.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\xu tility(2752) :
error C4439: 'std::fill' : function definition with a managed type in
the signature must have a __clrcall calling convention
C:\Program Files\Microsoft Visual Studio
8\VC\include\ve ctor(1187) : see reference to function template
instantiation 'void std::fill<Syste m::String^*,_Ty >(_FwdIt,_FwdIt ,const
_Ty &)' being compiled
with
[
_Ty=System::Str ing ^,
_FwdIt=System:: String ^*
]
C:\Program Files\Microsoft Visual Studio
8\VC\include\ve ctor(1117) : while compiling class template member
function 'void
std::vector<_Ty >::_Insert_n(st d::_Vector_iter ator<_Ty,_Alloc >,unsigned
int,const _Ty &)'
with
[
_Ty=System::Str ing ^,
_Alloc=std::all ocator<System:: String ^>
]
.\cppcli1.cpp(1 1) : see reference to class template
instantiation 'std::vector<_T y>' being compiled
with
[
_Ty=System::Str ing ^
]
C:\Program Files\Microsoft Visual Studio 8\VC\include\xu tility(3021) :
error C4439: 'stdext::_Unche cked_move_backw ard' : function definition
with a managed type in the signature must have a __clrcall calling
convention
C:\Program Files\Microsoft Visual Studio
8\VC\include\ve ctor(1200) : see reference to function template
instantiation '_BidIt2
stdext::_Unchec ked_move_backwa rd<System::Stri ng^*,System::St ring^*>(_BidIt1 ,_BidIt1,_BidIt 2)'
being compiled
with
[
_BidIt2=System: :String ^*,
_BidIt1=System: :String ^*
]
Build Time 0:03
Build log was saved at
"file://c:\temp\code\cp pcli1\cppcli1\D ebug\BuildLog.h tm"
cppcli1 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
There's a C:\Program Files\Microsoft Visual Studio 8\VC\include\ms clr
folder, but it has only few header, like auto_gcroot.h.
I've found some __CLRCALL_OR_CD ECL macros before STL functions, and it
resolves to __clrcall if you're using /clr. But I didn't get it to work
even with just /clr (no pure or safe). Any ideas?
Rodrigo Strauss