Author Topic: Differences in PLug-Ins template  (Read 7478 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Differences in PLug-Ins template
« on: October 25, 2005, 07:37:55 pm »
A little wrap up of some changes from RC1 -> RC2

Some differences in the generated files when you select create a plug-in with the wizard (in the case of type general) :
1) the project file (.cbp)
  - the doctype and CodeBlocks tags : Code::Blocks -> CodeBlocks
  - removed : inside <Target> : <Option external_deps=""/>
  - added : within the <Build> tags :
         <Environment>
            <Variable name="WX_VER" value="26"/>
            <Variable name="WX_DIR" value="C:\wxWidgets-2.6.1"/>
            <Variable name="WX_CFG" value="NonUnicode"/>
            <Variable name="CB_SDK" value="C:\codeblocks-1.0rc2"/>
         </Environment>
  - added : within the <Compiler> tags :
         <Add option="-Wall"/>
         <Add option="-g"/>
         <Add directory="$(WX_DIR)\include"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll\msw"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)\msw"/>
         <Add directory="$(WX_DIR)\contrib\include"/>
         <Add directory="$(CB_SDK)\include"/>
         <Add directory="$(CB_SDK)\sdk"/>
         <Add directory="$(CB_SDK)\sdk\tinyxml"/>
         <Add directory="$(CB_SDK)\sdk\wxscintilla\include"/>
  - added : within the <Linker> tags :
         <Add directory="$(WX_DIR)\lib\gcc_dll\msw"/>
         <Add directory="$(WX_DIR)\lib\gcc_dll$(WX_CFG)"/>
         <Add directory="$(CB_SDK)\lib"/>
         <Add directory="$(CB_SDK)\devel"/>
         <Add directory="$(CB_SDK)\sdk\tinyxml"/>
         <Add directory="$(CB_SDK)\sdk\wxscintilla\include"/>
  - modified : within the linker tags :
         <Add library="wxmsw242"/>
                  becomes
         <Add library="wxmsw$(WX_VER)"/>


2) The header file (.h) :
  - modified :
      void BuildToolBar(wxToolBar* toolBar);
           becomes
      bool BuildToolBar(wxToolBar* toolBar);

#ifdef __cplusplus
extern "C" {
#endif
   PLUGIN_EXPORT cbPlugin* GetPlugin();
#ifdef __cplusplus
};
#endif
            becomes
// Declare the plugin's hooks
CB_DECLARE_PLUGIN();

3) the implementation file (.cpp) :
  - removed : Created entry in the upper comments
  - modified :
cbPlugin* GetPlugin()
{
   return new test;
}
                                                               becomes
// Implement the plugin's hooks
CB_IMPLEMENT_PLUGIN(Test);

  - modified : all arguments to the NotImplemented() funtions are now _(x)
  - modified : return value of BuildToolBar() : return true if you add toolbar items


So that notice of the fact that directories for compiler and linker are now added by default, you just need to check if the values of
WX_DIR
WX_VER
WX_CFG
CB_SDK

are ok for your setup.

kind regards,
Lieven