Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: stahta01 on December 05, 2013, 12:39:15 am

Title: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 05, 2013, 12:39:15 am
I was just building several 3rd Party CB Plugins and I wondered why the wxscintilla_cb is a static Library in Windows?
And, if it needs to be a static Library in Windows could we ship it will the CB Windows Installer?
Its seems to be the main/only Library missing for building 3rd Party CB Plugins.
The others are shipped as DLLs and you can link directly to them.
I am working on making CB Plugin wizard better from at least my view point (for Windows Users).

Tim S.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: ollydbg on December 05, 2013, 05:27:19 am
Related discussion:
Code::Blocks, Scintilla and Fedora (http://forums.codeblocks.org/index.php/topic,13538.msg91152.html#msg91152)
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 05, 2013, 06:21:37 am
Related discussion:
Code::Blocks, Scintilla and Fedora (http://forums.codeblocks.org/index.php/topic,13538.msg91152.html#msg91152)

So, it reads like it needs to be static on a Linux Distro and of course its simpler to keep static everywhere.

So, might we plan on making a zipped version of the Windows wxscintilla_cb static lib file available for each time we do a full release.
I think this might help doing 3rd party CB Plugins.

Note: I have built a CB Project that just creates the wxscintilla_cb static lib file as a alternate solution for my own testing.
I could just submit that CB Project instead of making the CB Team making the Windows wxscintilla_cb static lib file available to download.

I am just not sure which method is the best one to do.

Edit: In case my reason for doing this is NOT obvious right now to make a CB Plugin under windows you really have to be able to build CB from source under Windows. And, this seems to be too hard for some people. And, it is error prone for people to build plugins that work with the last official release. I hope the if a wxscintilla_cb static lib file along with better directions and a modified CB Plugin Wizard will make this easier to do.

Edit2: Does anyone know of any other CB Static lib that is used to build third party plugins?

Tim S.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 05, 2013, 07:23:42 am
I thought maybe the static tinyxml lib was being used; but, it appears to not be used.

Can someone double check?

Patch to remove what appears to be unneeded library search path for tinyxml.

Removed patch; will posted updated version later today that only fixes wxWidgets 3.0 CB Projects.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: osdt on December 05, 2013, 09:11:43 am
I was just building several 3rd Party CB Plugins and I wondered why the wxscintilla_cb is a static Library in Windows?
And, if it needs to be a static Library in Windows could we ship it will the CB Windows Installer?
Its seems to be the main/only Library missing for building 3rd Party CB Plugins.
The others are shipped as DLLs and you can link directly to them.
I am working on making CB Plugin wizard better from at least my view point (for Windows Users).

Tim S.

I'd first check if the 3rd Party Plugins really have to be linked against wxscintilla_cb. If you search the C::B source tree, only 'Codeblocks-SDK' and 'Tools Plus' are explicitly linked against it. Even 'Tools Plus' builds and links fine without it (just tested on linux).

Grep *.cbp for "library=\"wxscintilla_cb\"":
Code
$ grep "library=\"wxscintilla_cb\"" $(find . -name "*.cbp")

./CodeBlocks-unix.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx29-unix.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx29.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx29_64.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx30-unix.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx30.cbp: <Add library="wxscintilla_cb" />
./CodeBlocks_wx30_64.cbp: <Add library="wxscintilla_cb" />
./plugins/contrib/ToolsPlus/ToolsPlus-unix.cbp: <Add library="wxscintilla_cb" />
./plugins/contrib/ToolsPlus/ToolsPlus.cbp: <Add library="wxscintilla_cb" />
./plugins/contrib/ToolsPlus/ToolsPlus_wx29-unix.cbp: <Add library="wxscintilla_cb" />
./plugins/contrib/ToolsPlus/ToolsPlus_wx30-unix.cbp: <Add library="wxscintilla_cb" />

- osdt
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: Jenna on December 05, 2013, 09:16:06 am
If you link against codeblocks lib, you can not (at least should not) link against the cb_scintilla lib.
We already had hard to determine (more or less random) crashes, due to linking against static libs twice in wxSmith, which was linked against codeblocks (already including tinyxml) and tinyxml directly.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 05, 2013, 05:23:39 pm
If you link against codeblocks lib, you can not (at least should not) link against the cb_scintilla lib.
We already had hard to determine (more or less random) crashes, due to linking against static libs twice in wxSmith, which was linked against codeblocks (already including tinyxml) and tinyxml directly.

Thank you, I will try to find how to submit changes for cbDiff Plugin once I confirm the issues exist in the current source.
Edit: Found the git version control.

Tim S.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 14, 2013, 07:25:04 am
Patch to CB Contrib projects that have wxscintilla_cb library used.
Patch needs tested; so, I would suggest waiting to after release is finished.

Removed patch; will posted updated version later today that only fixes wxWidgets 3.0 CB Projects.



Tim S.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 14, 2013, 05:41:28 pm
Removes the linker search folder sdk/scripting/lib patch.
Suggest waiting till after release to apply; this patch needs tested!

Tim S.

Removed patch; will posted updated version later today that only fixes wxWidgets 3.0 CB Projects.

Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on December 14, 2013, 05:43:00 pm
Removes linking and searching for tinyxml for contrib plugins.
This patch needs tested! Esp. the Makefile.am change!

Tim S.

Removed patch; will posted updated version later today that only fixes wxWidgets 3.0 CB Projects.

Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on January 03, 2014, 06:10:09 pm
The static libs wxscintilla_cb and tinyxml are both part of the CodeBlocks library therefore the linking and dependency on them should not exist outside of building the CodeBlocks library. One known exception is the CB Config Share standalone executable.

The sdk/propgrid library search  folder should NOT be used in wxWidgets 3.0 CB Projects.

I am testing patches to fix these issues right now.
Likely take an hour or two to finish testing.

Will attach patches to this post later today.

Tested Windows wx30 32-bit projects ONLY.

Code
Index: src/CodeBlocks_wx30.cbp
===================================================================
--- src/CodeBlocks_wx30.cbp (revision 9521)
+++ src/CodeBlocks_wx30.cbp (working copy)
@@ -166,7 +166,6 @@
  <Add library="gdi32" />
  <Add directory="devel30" />
  <Add directory="sdk/scripting/lib" />
- <Add directory="sdk/propgrid" />
  </Linker>
  <ExtraCommands>
  <Add before="build_tools/autorevision/autorevision30 +wx +int +t . include/autorevision.h" />
Index: src/CodeBlocks_wx30_64.cbp
===================================================================
--- src/CodeBlocks_wx30_64.cbp (revision 9521)
+++ src/CodeBlocks_wx30_64.cbp (working copy)
@@ -166,7 +166,6 @@
  <Add library="gdi32" />
  <Add directory="devel30_64" />
  <Add directory="sdk/scripting/lib" />
- <Add directory="sdk/propgrid" />
  </Linker>
  <ExtraCommands>
  <Add before="build_tools/autorevision/autorevision30_64 +wx +int +t . include/autorevision.h" />

Removed deleted patch(es) that was applied to SVN.

Tim S.
Title: Re: Question about why wxscintilla_cb is a static Library instead of Shared Lib?
Post by: stahta01 on January 03, 2014, 08:09:30 pm
I am doing stuff that changes WX_CFG and decided to submit a patch that adds WX_CFG to the CB Projects.
(In some case it just renames WX_CONFIG to WX_CFG.)

I have NOT tested this patch; except for wx28 32bit CB Windows projects.

I added a few more CB Projects; did NOT add "src/plugins/debuggergdb/debuggergdb_test.cbp" because it failed to compile.
I only tested the Windows wx28 32-bit CB Projects.

Removed deleted patch(es) that was applied to SVN.

Tim S.