Author Topic: Trying to build this source code but no joy  (Read 3928 times)

Offline Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Trying to build this source code but no joy
« on: February 22, 2023, 11:49:30 pm »
Hello all, Id like to start by saying im very new to this program, have been learning bits a peices over the last week or so. however what brings me here is I am trying to find a way to build this GitHub source code of basically a fuel map editor for my particular engine of my car. It was made by a Land Rover owner but has stopped supporting it for a while and he use to have the working executable on his page. but this is nowhere to be found nowadays, the only thing I can get is the original source code on GitHub, I belive it was made using a very old version of Code Blocks and WXwidgets, i have tried compiling it to the best of my ability using different versions and MinGW with command promp commands etc, but wonder if I am missing somthing or questioning if its possible at all, to anybody who is wondering this is the page in particular, let me know of your findings, turning into a bit of a headache for me, thank you!  :-X https://github.com/Luca72/Td5MapEditor

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #1 on: February 23, 2023, 02:08:38 am »
Windows 32 bit and Linux 64 bit seems to have been the OS supported using wxWidgets 2.8.
Edit1: Windows support was ANSI instead of Unicode; but, Linux was both 32 bit and 64 bit using likely Unicode under Ubuntu
Edit2: Under windows, it was using Static Multilib build of wxWidgets 2.8.
Edit3: Without knowing your operating system info it is not worth any more of my time to see if it can still be built.

Tim S.
« Last Edit: February 23, 2023, 02:26:38 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 Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #2 on: February 23, 2023, 02:50:16 am »
Hello Tim, I've been trying to build this on windows 11 so far, my current setup where i can get it to "slightly" compile before throwing up narrowing errors and things like that, is a modern version of code blocks (works the same on older versions too) but it must be 2.8.12 version of WxWidgets is the oldest one I can find. but built with MinGW using CMD. Iv changed the environment variable too. and included/re-named the "setup_inc" file. to just "setup" in order to be recognised. from that point I can go no further. you definately raise a good point, I wouldnt mind using a copy of ubuntu or somthing like that if it would make things easier, seemes like its definately possible but like theres a hurdle somewhere for sure. thank you for the reply  ;D

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #3 on: February 23, 2023, 03:14:12 am »
Renaming setup_inc is WRONG!!!
Edit2: Okay; my build just errored out and your post make more sense.

I suggest you build wxWidgets the correct way.
Renaming a file because you are missing setup.h means you likely never built wxwigets at all or setup Code::Blocks wrong.

Website that helps newbies on wxWidgets is https://forums.wxwidgets.org/.

If you have already built wxwidgets post the command used to build wx here.

Edit: I am building wxWidgets 2.8.x right now; likely be a few hours before if finishes or errors out.

Tim S.
« Last Edit: February 23, 2023, 03:30: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 Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #4 on: February 23, 2023, 03:19:15 am »
That is correct I am very new to this, apologies for my lack of experience, Have been trying quite a few things am just looking for some clarity on the subject or some guidence on where to go from here, Will have a look into that article thank you   :)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #5 on: February 23, 2023, 03:40:09 am »
wxWidgets 2.8.x is very old; the narrowing error I got is likely because the GCC 12.2.0 compiler I am using checks for more problems.
I guessed at a possible fix for it and re-started the build likely it will fail again; but, it might not.
Been a few years since I built wxWidgets 2.8.x (I think the x was 12; but, I  am not sure); I am building the git repo with changes I did about 5 years back. I am building using MSys2 MINGW32 GCC.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #6 on: February 23, 2023, 04:32:19 am »
Two patches that I have applied today to my copy of wxWidgets 2.8 branch.

Code
--- a/src/msw/utilsexc.cpp
+++ b/src/msw/utilsexc.cpp
@@ -879,7 +879,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
                 wxFAIL_MSG( _T("unexpected WaitForInputIdle() return code") );
                 // fall through
 
-            case -1:
+            case WAIT_FAILED:
                 wxLogLastError(_T("WaitForInputIdle() in wxExecute"));
 
             case WAIT_TIMEOUT:
--

Code
--- a/src/msw/mediactrl_am.cpp
+++ b/src/msw/mediactrl_am.cpp
@@ -2179,7 +2179,7 @@ void wxAMMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y),
 //---------------------------------------------------------------------------
 void wxAMMediaEvtHandler::OnActiveX(wxActiveXEvent& event)
 {
-    switch(event.GetDispatchId())
+    switch(static_cast<unsigned long>(event.GetDispatchId()))
     {
 #ifndef __WXWINCE__
     case 0x00000001: // statechange in IActiveMovie
--

The changes  are what I saw in wxWidgets master branch.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #7 on: February 23, 2023, 06:44:38 am »
Based on the code changes I had to do to get the project to build I think the code was likely updated to build using wxWidgets 3.0.
I go it to build using wxWidgets 2.8.x Unicode (I cannot seem to get wxWidgets ANSI (non-Unicode) to build).

Edit: Add link to the git repo I did the changes in https://github.com/stahta01/Td5MapEditor/tree/cb_cleanup

Tim S.
« Last Edit: February 23, 2023, 07:04:15 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 Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #8 on: February 23, 2023, 10:53:17 am »
Brilliant, I shall give it a look, Thank you for taking the time todo this Tim I greately appreciate this  :D

Edit: Just to confirm Tim in order to get it to build for me, Will I need to use the same settings as before, WxWidgets 2.8x and compiled using /makefile.gcc on CMD with the command
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean

Then without the clean, Then same for the Debug build?

« Last Edit: February 23, 2023, 11:06:07 am by Blenderpi »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #9 on: February 24, 2023, 02:20:50 am »
Brilliant, I shall give it a look, Thank you for taking the time todo this Tim I greately appreciate this  :D

Edit: Just to confirm Tim in order to get it to build for me, Will I need to use the same settings as before, WxWidgets 2.8x and compiled using /makefile.gcc on CMD with the command
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean

Then without the clean, Then same for the Debug build?

That is not the correct setting for what you are trying to build!
From memory this should work; but, I did not use that.
Code
mingw32-make -f makefile.gcc MONOLITHIC=0 SHARED=0 UNICODE=1 BUILD=release
I added these options; the "USE_ODBC=1" was added for this project; I do not think it was needed so you likely can build without it just remove the ODBC library from the CB Project; but, since I had no idea if the project needed it or not I built the wxWidgets to match the CB Project file.
The "USE_OPENGL=1" was added just because other people add it and it is not needed for your CB project.
Code
  CXXFLAGS=-std=gnu++11 CPPFLAGS=-D_WIN32_IE=0x0603 USE_OPENGL=1 USE_ODBC=1
The other options I added because in the past building wxWidgets 2.8.x required them; it likely still does need them.

I would suggest using a new folder because cleaning does NOT work when you change the value of MONOLITHIC from past experience.

What I would use to build combined in one line
Code
mingw32-make -f makefile.gcc MONOLITHIC=0 SHARED=0 UNICODE=1 BUILD=release CXXFLAGS=-std=gnu++11 CPPFLAGS=-D_WIN32_IE=0x0603 USE_ODBC=1

Tim S.




 
« Last Edit: February 24, 2023, 02:24:57 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #10 on: February 26, 2023, 08:03:01 am »
Website that helps newbies on wxWidgets is https://forums.wxwidgets.org/.

DO NOT PM ME FOR NO REASON OTHER THAN YOU BEING UNABLE TO READ.

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 Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #11 on: February 26, 2023, 03:44:30 pm »
Gosh never expected that, thanks  :-\ Im extremely new to this. excuse me for asking for a little bit more detail privately. But that was a little uncalled for. I hope you don't do this to people you regulary converse with

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Trying to build this source code but no joy
« Reply #12 on: February 27, 2023, 01:30:08 am »
Gosh never expected that, thanks  :-\ Im extremely new to this. excuse me for asking for a little bit more detail privately. But that was a little uncalled for. I hope you don't do this to people you regulary converse with

I suggest learning how the Internet works; on this website PM are not for things that belong on the forum!

Please read the rules before your posts get deleted. http://forums.codeblocks.org/index.php/topic,9996.0.html

I consider building wxWidgets on topic. I also consider updating CB Projects completely on topic.

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 Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #13 on: February 27, 2023, 03:58:46 pm »
Apologies, I was unaware. Thanks once again for the help Tim

Offline Blenderpi

  • Single posting newcomer
  • *
  • Posts: 7
Re: Trying to build this source code but no joy
« Reply #14 on: April 15, 2023, 03:49:14 pm »
All good, managed to sort it out. Finally have a working executable, thank you again genuinely would not have been possible without your work  :)