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

From Code::Blocks
m (→‎Step One: + SDK is merged with CB sources)
(→‎Procedure: + expand with comments)
Line 8: Line 8:
 
=Procedure=
 
=Procedure=
  
====Step One====
+
====Step One - Get Binaries ====
Download and install Code::Blocks release 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 To build your plugin you will also need Code::Blocks SDK for your version, which is currently merged in CB sources, so checkout them from [https://www.codeblocks.org/downloads/7 SVN] if you haven't done so already.
+
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
 +
 +
Then add the needed libraries to the linker to compile the plugin. These are wxmsw28u_gcc_cb.dll and codeblocks.dll. You don't need to write the .dll extension or the lib word (if present) so they will look like this on the linker options:
 +
 +
*codeblocks
 
*wxmsw28u_gcc_cb
 
*wxmsw28u_gcc_cb
*codeblocks
+
 
 +
====Step Five - Package ====
 +
Wrap your plugin in .cbplugin archive as described in [[Managing Plug-in Resources]] page. That's all.
  
 
=Conclusion=
 
=Conclusion=

Revision as of 11:13, 12 September 2008

Work in Progress!!!

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

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

  • codeblocks
  • wxmsw28u_gcc_cb

Step Five - Package

Wrap your plugin in .cbplugin archive as described in Managing Plug-in Resources page. That's all.

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 as add some images. Good Luck!