Re: Problem understanding some warnings

Julien Marrec <[email protected]> Thu, 20 Jan 2022 09:29:50 +0100
Newsgroups gmane.comp.programming.swig
Message-ID <CAEqKKtwmJSuypCBvCg4JA=muruWGds+MCCjVeQRL8tk+gS4w_w@mail.gmail.com>
Alessandro,

For the 402, are you sure you're correctly including the header file where
the CartridgeWidget class is defined in your swig interface file? If you
use the pImpl idiom for eg that means including the _Impl.hpp file in
addition to the .hpp one.

For the 516, just %ignore the specific overload you want to discard.

eg, your .i file could look like this:

```
#ifndef MYCLASS_I
#define MYCLASS_I

%{
  #include "MyClass.hpp"
%}

#ifdef SWIGJAVA
  %ignore mynamespace::MyClass::GetPixels() const;
#endif

%include <MyClass.hpp>

#endif // MYCLASS_I
```

(Disclaimer: I am just a swig user like you and the above might not be the
most correct advice...)

Best,
--
Julien Marrec, EBCP, BPI MFBA
Owner at EffiBEM <http://www.effibem.com>
T: +33 6 95 14 42 13

LinkedIn (en <https://www.linkedin.com/in/julienmarrec>) *| *(fr
<https://fr.linkedin.com/in/julienmarrec/fr>) :
<http://www.linkedin.com/in/julienmarrec>


Le mer. 19 janv. 2022 à 11:56, Alessandro L. <[email protected]> a écrit :

> Hello,
> I am using SWIG on a large project to generate the Java code to use on
> Android.
>
> I had a few warnings, mainly related to operator overloading, that I got
> rid of by means of %rename.
>
>  I now am facing the remaining 2 warnings.
>
> They are as follows:
> Warning 402: Base class 'CartridgeWidget' is incomplete.
> Warning 402: Only forward declaration 'CartridgeWidget' was found.
>
> Warning 516: Overloaded method GetPixels() const ignored
> Warning 516: using GetPixels() instead.
>
>
> Now for Warning 516 I understand that there are two methods
> GetPixels() and
> GetPixels() const that cannot be translated to Java due to the lack of
> support for overloading such method. And this is fine, but I am not able to
> silence this warning (I am using -Wall to compile).
>
> For Warning 402 I would really appreciate it if someone could shed a light
> on it. I can post some code snippets if needed.
>
> Thanks for your help,
> Alessandro
> _______________________________________________
> Swig-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>

_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user