News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Question about why wxscintilla_cb is a static Library instead of Shared Lib?

Started by stahta01, December 05, 2013, 12:39:15 AM

Previous topic - Next topic

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ollydbg

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.

stahta01

Quote from: ollydbg on December 05, 2013, 05:27:19 AM
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

osdt

Quote from: 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.

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\"":
$ 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

Jenna

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.

stahta01

Quote from: jens 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.

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]