Re: C++ Base Class Not Recognized

William S Fulton <[email protected]> Sun, 24 May 2026 15:46:30 +0100
Newsgroups gmane.comp.programming.swig
Message-ID <CANGqftC7xx6Vr-D1+bDdGU12ddakADSZKs4yFGu8Vdpzcpdvcg@mail.gmail.com>
--===============8256487166583861089==
Content-Type: multipart/alternative; boundary="000000000000f8566606529155f3"

--000000000000f8566606529155f3
Content-Type: text/plain; charset="UTF-8"

Concepts and require statements have been implemented for swig-4.5.0, so
perhaps you can try master to see if that resolves all your issues.

William

On Fri, 22 May 2026 at 03:32, William Tribley <[email protected]> wrote:

> Hi William,
> I found some of it. On a template I had a requires... statement which SWIG
> doesn't recognize. There was no warning.
>
> At present some of the references to ModelSignalBase have the namespace,
> some do not. I believe that it's having problems with nested namespace
> invocations.
>
> At any rate, I have everything except this working now. Search/replace for
> namespace is trivial.
>
> Thanks for your help,
> Bill
>
>
>
> From: William Tribley <[email protected]>
> To: "William S Fulton"<[email protected]>
> Cc: "swig-user"<[email protected]>
> Date: Thu, 14 May 2026 18:08:34 -0500
> Subject: Re: [Swig-user] C++ Base Class Not Recognized
>
> Hi William,
> Thank you for your response. I'll take another look at this next week.
> Fighting std_vector and std_unordered_list wars today...
> Have a good weekend,
> Bill
>
>
>
> From: William S Fulton <[email protected]>
> To: "William Tribley"<[email protected]>
> Cc: "swig-user"<[email protected]>
> Date: Thu, 14 May 2026 16:45:40 -0500
> Subject: Re: [Swig-user] C++ Base Class Not Recognized
>
> You don't show all the inputs. You should fully qualify the types in
> %template. If that doesn't work write a simple reproducible example and
> post here.
>
> William
>
> On Tue, 12 May 2026 at 21:41, William Tribley <[email protected]> wrote:
>
> Greetings,
> I have this c++ code:
>
>
> namespace ModelAPI
> {
>         class ModelSignalBase
>         {
>         public:
>                 ModelSignalBase()
>                 {
> ....
>
>         class ModelSignal : public ModelSignalBase
>         {
>         public:
>                 /// <summary>
>                 /// Copy constructor.
>                 /// </summary>
>                 /// <param name="ms">ModelSignal to copy.</param>
>                 ModelSignal(const ModelSignal& ms)
> ....
>
>
> In the generated cxx file the namespace is not included:
>
> ...
> SWIGEXPORT void JNICALL Java_TiwsModelApiJNI_modelSignals_1set(JNIEnv
> *jenv, jclass jcls, jlong jarg1) {
>   std::vector< ModelSignalBase * > arg1 ;
>   std::vector< ModelSignalBase * > *argp1 ;
>
>   (void)jenv;
>   (void)jcls;
>   argp1 = *(std::vector< ModelSignalBase * > **)&jarg1;
>   if (!argp1) {
> ...
>
> The entire class structure that I'm wrapping in SWIG is in namespace
> ModelAPI. The code compiles and runs in C++.
>
> Any hints or ideas appreciated.
>
> Best regards,
> Bill
>
>
> _______________________________________________
> Swig-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
>
>
>
>
>

--000000000000f8566606529155f3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Concepts and require statements have been implemented=
 for swig-4.5.0, so perhaps you can try master to see if that resolves all =
your issues.</div><div><br></div><div>William</div></div><br><div class=3D"=
gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On=
 Fri, 22 May 2026 at 03:32, William Tribley &lt;<a href=3D"mailto:bill@trib=
ley.org">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex"><u></u><div><div style=3D"font-family:Verdana,Aria=
l,Helvetica,sans-serif;font-size:12pt"><div style=3D"font-family:Verdana,Ar=
ial,Helvetica,sans-serif;font-size:12pt"><div>Hi William,<br></div><div>I f=
ound some of it. On a template I had a requires... statement which SWIG doe=
sn&#39;t recognize. There was no warning.<br></div><div><br></div><div>At p=
resent some of the references to ModelSignalBase have the namespace, some d=
o not. I believe that it&#39;s having problems with nested namespace invoca=
tions.<br></div><div><br></div><div>At any rate, I have everything except t=
his working now. Search/replace for namespace is trivial.=C2=A0<br></div><d=
iv><br></div><div>Thanks for your help,<br></div><div>Bill</div><div><br></=
div><div style=3D"border-top:1px solid rgb(204,204,204);min-height:0px;marg=
in-top:10px;margin-bottom:10px;line-height:0px"><br></div><div><div><br></d=
iv><div id=3D"m_3896641692824077134x_7463885301">From: William Tribley &lt;=
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&=
gt;<br>To: &quot;William S Fulton&quot;&lt;<a href=3D"mailto:wsf@fultondesi=
gns.co.uk" target=3D"_blank">[email protected]</a>&gt;<br>Cc: &quot;s=
wig-user&quot;&lt;<a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>&gt;<br>Date: Thu, 14 May 20=
26 18:08:34 -0500<br>Subject: Re: [Swig-user] C++ Base Class Not Recognized=
<br></div><div><br></div><blockquote id=3D"m_3896641692824077134x_746388530=
blockquote_zmail" style=3D"margin:0px"><div><div style=3D"font-family:Verda=
na,Arial,Helvetica,sans-serif;font-size:12pt"><div>Hi William,<br></div><di=
v>Thank you for your response. I&#39;ll take another look at this next week=
. Fighting std_vector and std_unordered_list wars today...<br></div><div>Ha=
ve a good weekend,<br></div><div>Bill<br></div><div><br></div><div style=3D=
"border-top:1px solid rgb(204,204,204);min-height:0px;margin-top:10px;margi=
n-bottom:10px;line-height:0px"><br></div><div><div><br></div><div id=3D"m_3=
896641692824077134x_12363321221">From: William S Fulton &lt;<a href=3D"mail=
to:[email protected]" target=3D"_blank">[email protected]</a>&g=
t;<br>To: &quot;William Tribley&quot;&lt;<a href=3D"mailto:[email protected]=
" target=3D"_blank">[email protected]</a>&gt;<br>Cc: &quot;swig-user&quot;&l=
t;<a href=3D"mailto:[email protected]" target=3D"_blank">swig=
[email protected]</a>&gt;<br>Date: Thu, 14 May 2026 16:45:40 -050=
0<br>Subject: Re: [Swig-user] C++ Base Class Not Recognized<br></div><div><=
br></div><blockquote style=3D"margin:0px" id=3D"m_3896641692824077134x_1236=
332122blockquote_zmail"><div><div dir=3D"ltr"><div>You don&#39;t show all t=
he inputs. You should fully qualify the types in %template. If that doesn&#=
39;t work write a simple reproducible example and post here.<br></div><div>=
<br></div><div>William<br></div></div><br><div><div dir=3D"ltr">On Tue, 12 =
May 2026 at 21:41, William Tribley &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockquote styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">Greetings,<br> I have this c++ code:<br> <br> <br> namespace Mo=
delAPI<br> {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 class ModelSignalBase<br> =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 public:<br> =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ModelSignalBase() <br>=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 { <br> ....<br> <b=
r> =C2=A0 =C2=A0 =C2=A0 =C2=A0 class ModelSignal : public ModelSignalBase<b=
r> =C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 public:<br=
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /// &lt;summary&g=
t;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /// Copy con=
structor.<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /// &=
lt;/summary&gt;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 /// &lt;param name=3D&quot;ms&quot;&gt;ModelSignal to copy.&lt;/param&gt;<=
br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ModelSignal(con=
st ModelSignal&amp; ms)<br> ....<br> <br> <br> In the generated cxx file th=
e namespace is not included:<br> <br> ...<br> SWIGEXPORT void JNICALL Java_=
TiwsModelApiJNI_modelSignals_1set(JNIEnv *jenv, jclass jcls, jlong jarg1) {=
<br> =C2=A0 std::vector&lt; ModelSignalBase * &gt; arg1 ;<br> =C2=A0 std::v=
ector&lt; ModelSignalBase * &gt; *argp1 ;<br> <br> =C2=A0 (void)jenv;<br> =
=C2=A0 (void)jcls;<br> =C2=A0 argp1 =3D *(std::vector&lt; ModelSignalBase *=
 &gt; **)&amp;jarg1; <br> =C2=A0 if (!argp1) {<br> ...<br> <br> The entire =
class structure that I&#39;m wrapping in SWIG is in namespace ModelAPI. The=
 code compiles and runs in C++.<br> <br> Any hints or ideas appreciated.<br=
> <br> Best regards,<br> Bill<br> <br> <br> _______________________________=
________________<br> Swig-user mailing list<br> <a href=3D"mailto:Swig-user=
@lists.sourceforge.net" target=3D"_blank">[email protected]</=
a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/swig-user" t=
arget=3D"_blank">https://lists.sourceforge.net/lists/listinfo/swig-user</a>=
<br></blockquote></div></div></blockquote></div><div><br></div></div><br></=
div></blockquote></div><div><br></div></div></div><br></div></blockquote></=
div>

--000000000000f8566606529155f3--


--===============8256487166583861089==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============8256487166583861089==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--===============8256487166583861089==--