Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: uriotcea on April 13, 2023, 04:54:57 pm

Title: GitBlock
Post by: uriotcea on April 13, 2023, 04:54:57 pm
Hi,

I tried desperately to compile this plugin, but no way, always an error at the end.
I'm looking for this plugin already compiled under windows, gitblock.dll

Thanks for your help
Title: Re: GitBlock
Post by: Miguel Gimenez on April 13, 2023, 05:22:42 pm
The compiler used to build C::B and the plugin must be the same, so a random dll will not work.

Post here the error you get (in code tags) and a link to the source code.
Title: Re: GitBlock
Post by: uriotcea on April 13, 2023, 08:23:48 pm
Hi,

Under windows10
gcc: mingw81_64
I'm using last wxWigdets release 3.2.2.1 compiled with mingw81
GitBlock from here https://github.com/tomolt/GitBlocks
I tried to compilt it using Code::block 20.03, but I did not compile code::block myseft.
Compilation ok, link failed with lot of message such as "C:\Cpp\CodeBlocks\wxWidgets-3.2.2.1\interface\wx\string.h|323|error: 'wxUniChar' does not name a type; did you mean 'wxPutchar'?"

Title: Re: GitBlock
Post by: stahta01 on April 13, 2023, 08:43:02 pm
Yes this project file is linux only...

You likely will not be able to compile this CB Plugin.
It is 8 years old; so, unless you wish to use a really old CB or fix this so it builds I think giving up is the correct thing to do.
Note: If you wish to continue; you need to be able to build wxWidgets with the oldest compatible mode on I think that is 2.8.
Then build Code::Blocks using that wxWidgets.
After you get both of those built you can try to build this plugin.

Tim S.
Title: Re: GitBlock
Post by: uriotcea on April 13, 2023, 08:49:37 pm
HI,

Thank you for your fast answer, it's getting really complicated, it's really annoying
Is there any way to integrate Git in codeblock?
Title: Re: GitBlock
Post by: stahta01 on April 13, 2023, 08:57:59 pm
HI,

Thank you for your fast answer, it's getting really complicated, it's really annoying
Is there any way to integrate Git in codeblock?

I used the ToolPlus plugin for some simple commands.

Tim S.
Title: Re: GitBlock
Post by: uriotcea on April 13, 2023, 09:02:18 pm
Ok tool+, I'm not very comfortable with this, do you have an example configuration?
Title: Re: GitBlock
Post by: cacb on April 13, 2023, 09:51:07 pm
HI,

Thank you for your fast answer, it's getting really complicated, it's really annoying
Is there any way to integrate Git in codeblock?


I have simply added "Git Gui here" in the Tools menu. Below is for Linux. The same can be done under Windows, but you need an intermediate tiny application to filter out a return value from "git gui" on windows.
https://github.com/arnholm/cpde_utils/blob/master/git_gui_win/main.cpp

For more advanced git commands I use a similar "Terminal Here"
Title: Re: GitBlock
Post by: stahta01 on April 14, 2023, 02:24:58 am
I got GitBlocks to build using wxWidgets 3.2.2.1 with 28 compatible mode; but, I would guess it will not work well

https://github.com/stahta01/GitBlocks/commit/5f90a704b6b54a10afb80b0a4528765f76e53054 (https://github.com/stahta01/GitBlocks/commit/5f90a704b6b54a10afb80b0a4528765f76e53054)

Edit: I got it to build and install using wxWidgets 3.2.2.1 with default 3.0 compatibility; but, it crashes when trying to use it.

Tim S.

Workaround patch to get CB to build with wxWidgets 3.2.2.1 with 28 compatible mode.

Code
--- src/src/main.cpp    (revision 13260)
+++ src/src/main.cpp    (working copy)
@@ -1478,7 +1478,7 @@

 void MainFrame::AddToolbarItem(int id, const wxString& title, const wxString& shortHelp, const wxString& longHelp, const wxString& image)
 {
-    m_pToolbar->AddTool(id, title, cbLoadBitmap(image, wxBITMAP_TYPE_PNG));
+    m_pToolbar->AddTool(id, title, wxBitmapBundle(cbLoadBitmap(image, wxBITMAP_TYPE_PNG)));
     m_pToolbar->SetToolShortHelp(id, shortHelp);
     m_pToolbar->SetToolLongHelp(id, longHelp);
 }
Title: Re: GitBlock
Post by: Miguel Gimenez on April 14, 2023, 02:20:39 pm
I compiled it with current trunk and wx3.2.2.1 using the attached project. I did not test the plugin, though.

To remove a warning about "no return value" just edit GitBlocks.cpp so it reads
Code
int GitBlocks::Configure()
{
return 0;
}
Title: Re: GitBlock
Post by: uriotcea on April 14, 2023, 02:33:00 pm
Hi,

Thank for your suggestions and help, but on my side I still have too many trouble, could you shared your "gitBlock.dll" file ?
Title: Re: GitBlock
Post by: Miguel Gimenez on April 14, 2023, 03:10:03 pm
Here you have it, but it will not work on your system if your setup is different from mine:
  - wxWidgets 3.2.2.1
  - C::B r13260
  - MinGW-w64 compiler generating 32-bit targets
Title: Re: GitBlock
Post by: uriotcea on April 14, 2023, 03:56:53 pm
Ok thank, I'll try, but file "gitblock.cbplugi" is missing, or there is another way to test it?
Title: Re: GitBlock
Post by: Miguel Gimenez on April 14, 2023, 04:58:12 pm
You can drop the dll and a zip containing the maniifest in the plugins folder, just mimic whatever is there.
Title: Re: GitBlock
Post by: uriotcea on April 14, 2023, 05:06:13 pm
Ok thank, as you previous that did not work:

- wxWidgets 3.13
  - C::B r11983
  - MinGW-w64 compiler generating 64-bit targets
Title: Re: GitBlock
Post by: stahta01 on April 14, 2023, 06:46:40 pm
https://github.com/stahta01/GitBlocks/releases/tag/2023.04.06 (https://github.com/stahta01/GitBlocks/releases/tag/2023.04.06)

Plugin for nightly build; I hope I did it correctly.

Tim S.
Title: Re: GitBlock
Post by: Miguel Gimenez on April 14, 2023, 06:49:13 pm
GitBlocks::Configure() should return 0 to avoid a compilation warning
Title: Re: GitBlock
Post by: stahta01 on April 14, 2023, 07:06:55 pm
GitBlocks::Configure() should return 0 to avoid a compilation warning

I am not editing code fixes for warnings; because it resulted in several  dozen lines being change for removing spaces in the file.
Also, I think it should likely have code added to it; because a function that has only a return 0 in it is likely not finished.

Edit: I added the return 0 after turning off some CB options so only that line was changed.
I still wonder if that was a good idea; but, I figure it was an dead repo for the last 6 to 10 years.

Edit2: I just used wxSmith to regenerate many of the files in this project.

Edit3: https://github.com/stahta01/GitBlocks (https://github.com/stahta01/GitBlocks)

Tim S.
Title: Re: GitBlock
Post by: MoiCJarod on February 26, 2024, 03:47:09 pm
Hello !
I just managed to compile the plugin on an Ubuntu 22.04 (why only a Windows Release ?). I was able to copy the file on a fresh install of code::blocks on a virtual machine and it just worked. I swated blood to achieve this, so I want to share the obtained file :
http://gofile.me/3fqRi/zGalYdJZh
Cheers !