c++ cli - msclr is not being used -
so reason, msclr not being used @ runtime, think, reason. code:
#include <stdlib.h> #include <string.h> #include <msclr\marshal.h> #include "stdafx.h" using namespace system; using namespace msclr::interop; int main() { const char* message = "test string marshal"; string^ result; result = marshal_as<string^>(message); return 0; }
i error: "c2653: 'msclr' : not class or namespace name" doesn't make sense @ all. boggles mind not computer other computer try using msclr. furthermore, visual studio not underlining ide recognizes namespace. please me? header positioned correctly show that's ot case lot of sites have stated. in advance.
when build on machine, first error displayed c2653 error mention. however, displays warnings heart of problem. first warning is:
warning c4627: '#include <stdlib.h>': skipped when looking precompiled header use.
when using precompiled header, important first line in .cpp
file
#include "stdafx.h"
once make line first line of .cpp
file, compiles properly.
Comments
Post a Comment