Author Topic: GitBlock  (Read 13681 times)

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
GitBlock
« 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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: GitBlock
« Reply #1 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.

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #2 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'?"


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlock
« Reply #3 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.
« Last Edit: April 13, 2023, 08:46:56 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #4 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlock
« Reply #5 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #6 on: April 13, 2023, 09:02:18 pm »
Ok tool+, I'm not very comfortable with this, do you have an example configuration?

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: GitBlock
« Reply #7 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"
« Last Edit: April 13, 2023, 09:54:58 pm by cacb »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlock
« Reply #8 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

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);
 }
« Last Edit: April 14, 2023, 05:27:03 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: GitBlock
« Reply #9 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;
}

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #10 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 ?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: GitBlock
« Reply #11 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

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #12 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?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: GitBlock
« Reply #13 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.

Offline uriotcea

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: GitBlock
« Reply #14 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlock
« Reply #15 on: April 14, 2023, 06:46:40 pm »
https://github.com/stahta01/GitBlocks/releases/tag/2023.04.06

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

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: GitBlock
« Reply #16 on: April 14, 2023, 06:49:13 pm »
GitBlocks::Configure() should return 0 to avoid a compilation warning

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: GitBlock
« Reply #17 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

Tim S.
« Last Edit: April 14, 2023, 10:11:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline MoiCJarod

  • Single posting newcomer
  • *
  • Posts: 1
Re: GitBlock
« Reply #18 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 !