swig-fortran / swig

This fork of SWIG creates Fortran wrapper code from C++ headers.
http://www.swig.org
Other
42 stars 11 forks source link

Opaque types conflict when present in multiple modules #142

Open sethrj opened 4 years ago

sethrj commented 4 years ago

If module A has a function that interacts with a SWIGTYPE (generic match for int* and classes), it will generate a derived type SWIGTYPE_p_int. If module B imports module A and also has a function that uses that same type, it too will generate the opaque type. Unfortunately, that means that the new type is incompatible with the old (meaning you will be unable to pass the same type between C++ functions), and even worse it generates a build error because module B has a use a statement that imports the type, so the names will confict.

Identified by @balos1