如何将std_string.i与swig c++;到c# 我尝试执行SWIG将C++代码转换成C语言。 我让教程代码如下。 在构建步骤中,它未能构建。 我认为这不包括财产

如何将std_string.i与swig c++;到c# 我尝试执行SWIG将C++代码转换成C语言。 我让教程代码如下。 在构建步骤中,它未能构建。 我认为这不包括财产,c#,linux,swig,C#,Linux,Swig,我怎样才能把它包括进去 下面的代码是我的教程代码 例如,我 %module example %include <std_string.i> %{ using namespace std; int my_mod(int x, int y); string getstring(string str); %} int my_mod(int x, int y); string getstring(string str); 错误消息如下所示 example_wrap.c: In func

我怎样才能把它包括进去

下面的代码是我的教程代码

例如,我

%module example
%include <std_string.i>
%{

using namespace std;
int my_mod(int x, int y);
string getstring(string str);
%}
int my_mod(int x, int y);
string getstring(string str);

错误消息如下所示

example_wrap.c: In function ‘void CSharp_std_set(void*)’:
example_wrap.c:292:18: error: expected ‘=’ before ‘;’ token
   namespace arg1 ;
                  ^
example_wrap.c:292:18: error: expected identifier before ‘;’ token
example_wrap.c:293:13: error: expected identifier before ‘*’ token
   namespace *argp1 ;
             ^
example_wrap.c:293:14: error: ‘argp1’ was not declared in this scope
   namespace *argp1 ;
              ^~~~~
example_wrap.c:293:14: note: suggested alternative: ‘jarg1’
   namespace *argp1 ;
              ^~~~~
              jarg1
example_wrap.c:295:12: error: expected primary-expression before ‘namespace’
   argp1 = (namespace *)jarg1;
            ^~~~~~~~~
example_wrap.c:295:12: error: expected ‘)’ before ‘namespace’
....