Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Swig Wrapper Files #2877

Open
codeground123 opened this issue Apr 17, 2024 · 0 comments
Open

Missing Swig Wrapper Files #2877

codeground123 opened this issue Apr 17, 2024 · 0 comments

Comments

@codeground123
Copy link

We have a large C++ Project and are trying to generate Csharp Wrapper files. I could not share the contents of the CPP files due to security issues. We are trying to use SWIG to generate Wrapper classes. Our Previous team did this and I see that they are generating around 30 wrapper files.

Now When I try to compile the filename.i interface file I see that few wrapper files are not getting generated like

Eg SWIGTYPE_p_long.cs. Swigtype_p_time._tcs, Swigtype_p_short.cs, SwigType_p_MTInt4.cs. These files are not getting generated whereas previously they used to get created. No Code changes were done since then.

My Interface file looks like below at high level

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

% module cppwrappername
% 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>

%}

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

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


I am new to SWIG and its very confusing where to look at it for this issue.
Is there any SWIG command to view the errors
Any pointers to where to look at this will help

I am running the below Swig command and see only 2 warnings

swig -csharp -c++ -outdir C:\pathname\Generated CPP_interface.i

emperror.h(52) : Warning 401: Nothing known about base class 'EMP::EMPException'. Ignored.
CPP_interface.i(38) : Warning 453: Can't apply (sem_t *). No typemaps are defined.

I am using Visual Studio and the paths to Linking are configured correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant