News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Trying to build this source code but no joy

Started by Blenderpi, February 22, 2023, 11:49:30 PM

Previous topic - Next topic

Blenderpi

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

stahta01

#1
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.
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]

Blenderpi

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

stahta01

#3
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.
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]

Blenderpi

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   :)

stahta01

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++.
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

Two patches that I have applied today to my copy of wxWidgets 2.8 branch.


--- 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:
--



--- 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++.
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

#7
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.
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]

Blenderpi

#8
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?


stahta01

#9
Quote from: Blenderpi 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?

That is not the correct setting for what you are trying to build!
From memory this should work; but, I did not use that.

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.

  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

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.




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

Quote from: stahta01 on February 23, 2023, 03:14:12 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++.
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]

Blenderpi

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

stahta01

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

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.next.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++.
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]

Blenderpi

Apologies, I was unaware. Thanks once again for the help Tim

Blenderpi

All good, managed to sort it out. Finally have a working executable, thank you again genuinely would not have been possible without your work  :)