On Thursday 17 September 2009 10:35:54 Liebe Markus (RtP2/TEF72) wrote:
> Hi there,
> 
> Is it possible to get a pointer to the cppplugin in an own plugin?
> At the moment I am trying to do:
> 
> void MyPlugin::extensionsInitialized(){
>         [...]
>         CppEditor::Internal::CppPlugin *cppPlugin =
>  pm->getObject<CppEditor::Internal::CppPlugin>(); [...]
> }
> But if I do this, my plugin gets not loaded anymore because of the
>  following undefined symbol:
>  _ZN9CppEditor8Internal9CppPlugin16staticMetaObjectE
> 
> On the other hand the procedure above works if I use the ProjectExplorer
>  instead of the CppPlugin:
> 
> void MyPlugin::extensionsInitialized(){
>         [...]
>         ProjectExplorer::ProjectExplorerPlugin *foo =
>  pm->getObject<ProjectExplorer::ProjectExplorerPlugin>(); [...]
> }
> 
> I already added the .pri file of the CppPlugin as an include to the .pro
>  file of my plugin according to what Enrico told me to fix another
>  undefined symbol: _ZN4Core8BaseMode16staticMetaObjectE which looks almost
>  the same. But the adding of the .pri file had no positive effect.

The class ProjectExplorerPlugin is exported:
class PROJECTEXPLORER_EXPORT ProjectExplorerPlugin

Whereas the class CppPlugin is not.

You can add CPPEDITOR_EXPORT in front of CppPlugin class, but this class is 
marked as Internal, so it shouldn't be used.
IMO, the best way is to create an exported function in CppEditor namespace, to 
access the function you need in CppPlugin.

Nicolas
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to