I do not understand where the legs grow from, the studio debugger from C ++ is from the Stone Age ... I understand that my mistake, but the studio gives a complete nonsense ...

.cpp:

// Helper.cpp #include "stdafx.h" #include "Helper.h" #include <stdlib.h> #include <string.h> #include <cstdio> namespace NativeCpp { System::String^ GetMyString() { System::String^ str = "MyString"; return str; } } 

.h:

 // Helper.h #pragma once using namespace System; using namespace NativeCpp; namespace Helper { public ref class Foundation { public: static String^ CheckStr() { String^ result = GetMyString(); return result; } }; } 
  • one
    what is the problem? - pavel
  • @pavel, well, judging by the title - in the compilation. C2871, C3861. As far as I remember, error codes in the studio for the native begin with the prefix C ... - Alexis
  • The full text of the errors would be to see ... Well, the debugger is not to blame, the errors cited would not allow it to start. - Vladimir Martyanov
  • The studio debugger is one of the best, if not the best. That only is the opportunity to stop the program, change the code on the fly, and continue execution. - Vladimir Gamalyan

1 answer 1

First comes the #include file inclusion. That is, in the place of include, the contents of the specified file are inserted.

It turns out you have such a code.

 using namespace System; using namespace NativeCpp; namespace Helper { public ref class Foundation { public: static String^ CheckStr() { String^ result = GetMyString(); //откуда взять GetMyString??? return result; } }; } namespace NativeCpp { System::String^ GetMyString() { System::String^ str = "MyString"; return str; } }