|
From: zhiyang j. <ja...@gm...> - 2008-06-10 01:19:33
|
2008/6/10 Dale Wilson <wi...@oc...>:
> Hi SWIG experts,
>
> I've run into a problem using SWIG Version 1.3.35 to wrap some C++ code
> for use by C#. I've created a simple test that demonstrates the problem.
>
> My C++ header file (Abc.h) contains:
>
> #ifndef ABC_H
> #define ABC_H
> #pragma warning (disable:4290) // VC: don't mutter about throw
> specification
> namespace one
> {
> class Unique
> {
> Unique();
> ~Unique();
> void test()const;
> };
> }
>
> namespace two
> {
> class Unique
> {
> Unique();
> ~Unique();
> void test()const;
> };
> }
> #endif // ABC_H
>
> and the AbcAdapter.swg file contains:
> %module AbcAdapter
> %{
> // Generated from AbcAdapter.swg
> #include "stdafx.h"
> #include "Abc.h"
> %}
> %include <stl.i>
> %include <std_common.i>
> %include "Abc.h"
>
>
> When I run the command:
>
> swig.exe -c++ -csharp -Fmicrosoft AbcAdapter.swg
>
> It says:
>
> Abc.h(19): Error: 'Unique' is multiply defined in the generated module.
> Abc.h(9): Error: Previous declaration of 'Unique'
> Project : error PRJ0019: A tool returned an error code from "Creating
> CSharp wrapper"
> --------------------
> So how can I convince SWIG to pay attention to the namespace when
> checking for duplicate class declarations?
>
> Thanks,
>
> Dale
>
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Swig-user mailing list
> Swi...@li...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>
see this url
http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus_nn31
--
Best Regards
Jiang
|