I have a CPP project and trying to create CSharp API using Swig.

Created a interface.i file to wrap all the header files. Compiling the file generates .cs files and few files with pattern SWIGTYPE_p_…..

What is the use of these files SWIGTYPE_p_…. Can I delete these files and only include .cs files in the build ?

Observed that few SWIGTYPE_p… files are not getting generated where previously they were generated. I have not made any code changes recently and have no idea where to look at.

Below is my sample .i file

// Swig interface file for C# wrapeer for c++ dll
//export module CPP_interface;

% module CMIPCppWrapper
% include <std_common.i>
% include <typemaps.i>
% include <std_string.i>
% include <std_wstring.i>
% include <std_vector.i>
% include <std_map.i>
% include <std_pair.i>
% include <windows.i>

using namespace std;

#define unix

% apply char[] { const unsigned char*};

namespace std {
    % apply const string& { string& };
};


#include <pthread.h>
#include <semaphore.h>
% apply sem_t* { Semaphore };

% {
#include <limits.h>
#include <float.h>
#include <string>
#include <iostream>
#include <sstream>
#include <semaphore.h>
#include <pthread.h>
#include <locale>


#include <emperror.h>
#include <empmessage.h>
#include <cmipcstatistics.h>

%}

% ignore  operator<<;
% ignore  operator=;
% ignore  operator==;
//%include "windows.h"

% include "emperror.h"
% include "empmessage.h"
% include "cmipcstatistics.h"

SWIGTYPE_p_emperror.cs file NOT generated. Any pointers where to look at ?

Khám phá các thẻ bài đăng