Difference between revisions of "Linking the plugin to a Nightly Build"

From Code::Blocks
(+ some screens)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This article describes how to link your plugin against the dll's shipped with codeblocks on windows.
+
[[Category:Plugin development]]
 +
This article describes how to assemble your plugin to work with officially released Code::Blocks distribution (either nightly or not) on Windows. It's accomplished by linking your plugin against the DLL's shipped with Code::Blocks.
  
 
=Introduction=
 
=Introduction=
Is useful to know how to compile Code::Blocks sources from scratch to link with our plugin, but when we want to share it with the community then we need to link it against the latest nightly build or final release of codeblocks. This is a simple procedure that many people doesn't know at first, and that will help you accelerate development in many ways. Enjoy :)
+
Is useful to know how to compile Code::Blocks sources from scratch to link with our plugin, but when we want to share it with the community then we need to link it against the latest nightly build or final release of Code::Blocks. This is a simple procedure that many people don't know at first. Enjoy :)
  
 
=Procedure=
 
=Procedure=
Here are the instructions divided in steps for the easy navigation of our eyes.
 
  
====Step One====
+
====Step One - Get Binaries ====
Download and install the latest nightly found on this forum /index.php/board,20.0.html Also you will need the Code::Blocks SDK so checkout the sources on berlios.de using svn.
+
Download and install version of Code::Blocks you would like to link your plugin with. You may choose either official release available from https://www.codeblocks.org/downloads/5 or latest nightly from this forum - /index.php/board,20.0.html
  
====Step Two====
+
====Step Two - Get Sources ====
Get the wxWidgets sources at http://wxwidgets.org and configure the setup.h to be compatible with the actual wxmsw28u_gcc_cb_wxXXX.dll compilation.
+
To ensure your plugin will run smoothly with chosen C::B version you need headers and libraries of this version as well as headers and libraries for wxWidgets library used by this Code::Blocks.
  
====Step Three====
+
Headers and libraries alone constitute SDK. In CB case headers are distributed with sources, libraries come with CB or can be recompiled from source if needed. Get sources for your required version of Code::Blocks from [https://www.codeblocks.org/downloads/7 SVN] if you haven't done so already.
After having your plugin up and running you will need to edit the compiler options and add the directory where your nightly is residing to the linker. Then add the needed libraries to the linker to compile the plugin that usually are wxmsw28u_gcc_cb.dll and libcodeblocks.dll. You don't need to write the .dll extension or the lib word so they will look like this on the linker Options:
 
  
 +
wxWidgets libraries need to be [https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_wxWidgets_in_Unicode_mode compiled] (or configured) or else you will most probably get "wx/setup.h: No such file or directory" message. Get version used to build your C::B at http://wxwidgets.org
 +
 +
====Step Three - Build Plugin ====
 +
Try to compile the plugin after building wxWidgets. It is ok if you got a message "cannot find -lcodeblocks" from ld.exe  It means that codeblocks library for linking plugin is missing, because library paths were not setup correctly. Next step will fix this.
 +
 +
====Step Four - Link Everything Together ====
 +
 +
After having your plugin compiled (or up and running if you prefer) you will need to edit the project build options and add the directory where your official release or nightly is residing to the linker. Project -> Build Options... -> Search directories -> Linker
 +
 +
[[Image:05_search_directories.png|none]]
 +
 +
Then add names of the needed libraries to the linker to assemble the plugin. These are wxmsw28u_gcc_cb.dll and codeblocks.dll. You don't need to write the .dll extension or the lib prefix (if present) so they will look like this on the linker options:
 +
 +
*codeblocks
 
*wxmsw28u_gcc_cb
 
*wxmsw28u_gcc_cb
*codeblocks
+
 
 +
 
 +
[[Image:05_linker_settings.png|none]]
 +
<br clear="all" />
 +
 
 +
====Step Five - Package ====
 +
Wrap your plugin in .cbplugin archive as described in [[Managing Plug-in Resources]] page.
  
 
=Conclusion=
 
=Conclusion=
You should now be able to compile the plugin and load it to the current nightly without the symbols error. A problem that many developers confront after compiling the plugin with a compilation that differs from the official one. This was a quick howto so is maybe missing info, I will update it later. Good Luck!
+
You should now be able to compile the plugin and load it to the current nightly without the symbols error. A problem that many developers confront after compiling the plugin with a compilation that differs from the official one.  
 +
 
 +
Good Luck!

Latest revision as of 11:46, 12 September 2008

This article describes how to assemble your plugin to work with officially released Code::Blocks distribution (either nightly or not) on Windows. It's accomplished by linking your plugin against the DLL's shipped with Code::Blocks.

Introduction

Is useful to know how to compile Code::Blocks sources from scratch to link with our plugin, but when we want to share it with the community then we need to link it against the latest nightly build or final release of Code::Blocks. This is a simple procedure that many people don't know at first. Enjoy :)

Procedure

Step One - Get Binaries

Download and install version of Code::Blocks you would like to link your plugin with. You may choose either official release available from https://www.codeblocks.org/downloads/5 or latest nightly from this forum - /index.php/board,20.0.html

Step Two - Get Sources

To ensure your plugin will run smoothly with chosen C::B version you need headers and libraries of this version as well as headers and libraries for wxWidgets library used by this Code::Blocks.

Headers and libraries alone constitute SDK. In CB case headers are distributed with sources, libraries come with CB or can be recompiled from source if needed. Get sources for your required version of Code::Blocks from SVN if you haven't done so already.

wxWidgets libraries need to be compiled (or configured) or else you will most probably get "wx/setup.h: No such file or directory" message. Get version used to build your C::B at http://wxwidgets.org

Step Three - Build Plugin

Try to compile the plugin after building wxWidgets. It is ok if you got a message "cannot find -lcodeblocks" from ld.exe It means that codeblocks library for linking plugin is missing, because library paths were not setup correctly. Next step will fix this.

Step Four - Link Everything Together

After having your plugin compiled (or up and running if you prefer) you will need to edit the project build options and add the directory where your official release or nightly is residing to the linker. Project -> Build Options... -> Search directories -> Linker

05 search directories.png

Then add names of the needed libraries to the linker to assemble the plugin. These are wxmsw28u_gcc_cb.dll and codeblocks.dll. You don't need to write the .dll extension or the lib prefix (if present) so they will look like this on the linker options:

  • codeblocks
  • wxmsw28u_gcc_cb


05 linker settings.png


Step Five - Package

Wrap your plugin in .cbplugin archive as described in Managing Plug-in Resources page.

Conclusion

You should now be able to compile the plugin and load it to the current nightly without the symbols error. A problem that many developers confront after compiling the plugin with a compilation that differs from the official one.

Good Luck!