Re: [Qgis-user] Qgis plugin and typeid issues

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Qgis-user] Qgis plugin and typeid issues

John C. Tull-2
Hi Emmanuel,

You probably want to send this to the dev list (cc'd in this email). Good luck with your work,
John

On Aug 23, 2010, at 2:08 AM, Emmanuel Christophe wrote:

> Hi all,
>
> I'm working on the OTB (www.orfeo-toolbox.org) Qgis plugins: the
> objective is to provide more raster processing capabilities to Qgis.
> I run into a tricky C++ issue. In one particular case, one typeid
> resolution does not seems to work. I believe that it is linked with
> the issue mentioned here:
>
> http://gcc.gnu.org/faq.html#dso
> dynamic_cast, throw, typeid don't work with shared libraries
>
> (I'm currently working with gcc and trying to make it work with shared
> libraries).
>
> What make me think that this is linked to this issue is that:
> - the plugin is loaded using dlopen by qgis
> - the typeid is created by some code compiled in the plugin (OTB uses
> templates extensively, so this particular piece of OTB code is
> compiled during the plugin compilation) and the resulting type_info is
> passed to another dynamic library that was compiled before (during OTB
> compilation).
>
> So it seems that we are in the third case mentioned by the FAQ. In
> this situation, the FAQ recommend to
> "First, export global symbols from the executable by linking it with
> the "-E" flag. You must also make the external symbols in the loaded
> library available for subsequent libraries by providing the
> RTLD_GLOBAL flag to dlopen. The symbol resolution can be immediate or
> lazy."
>
> The RTLD_GLOBAL flag seems to be provided
> (src/app/qgspluginmanager.cpp:256), but I'm not sure about the -E flag
> while linking. Can anybody with more experience in Qgis compilation
> confirm?
>
> Is there any other plugin I should look at for inspiration?
>
> Emmanuel
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-user

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer