Author Topic: Question about why wxscintilla_cb is a static Library instead of Shared Lib?  (Read 12948 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.
« Last Edit: December 05, 2013, 12:42:42 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Related discussion:
Code::Blocks, Scintilla and Fedora

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.
« Last Edit: December 05, 2013, 06:46:46 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.
« Last Edit: January 03, 2014, 06:03:54 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.
« Last Edit: December 05, 2013, 06:40:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.
« Last Edit: January 03, 2014, 06:03:19 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.

« Last Edit: January 03, 2014, 06:02:56 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.

« Last Edit: January 03, 2014, 06:02:34 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.
« Last Edit: January 05, 2014, 04:44:26 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
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.

« Last Edit: January 05, 2014, 04:43:57 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org