Building from source

General info and how-to

Moderator: Global Moderator

Post Reply
Ben78
Newbie
Posts: 4
Joined: Fri Feb 21, 2025 1:29 am

Building from source

Post by Ben78 »

Hi,
For context I studied Computer Science in the late 90's, however am by no means a developer. I can read and understand the code but having never been in the industry (I work in data and mechanical assets) the use of build environments and tools is very new to me.

I have spent a couple of days installing various versions of Qt, MSYS, MinGW, OpenSSL and have had very little success in achieving a final compiled version of FastECU.

I am interested in the project and feel I may have something to add if I am able to successfully compile a working exe.
Would it be possible to have some guidance on what and how I need to install the various tools to do this?

For example, in the Issues section regarding Build in Github there is the line " Just make sure Qt contains QtSerial, QtCharts and QtXml modules and that MinGW is 32-bit version so that OpenPort drivers works" but the Qt Maintenance Tool doesn't allow for these modules to be included in Qt5.15, and the only kits that can be included are for 64 bit MinGW.

Thanks!
Ben
alesv
Hero Member
Posts: 551
Joined: Mon Jul 15, 2024 3:23 pm

Re: Building from source

Post by alesv »

Hi,

I assume you are using Windows. Please note that you need 32-bit versions of Qt, GCC and OpenSSL because most of J2534 drivers are 32-bit for now.

Please try the following.
  1. Get the "toolchain" here. You'll need both Qt prebuilt framework and GCC binaries.
  2. Unpack prebuilt framework to a folder you had installed Qt, say QT_INSTALL_DIR.
  3. Unpack GCC binaries to QT_INSTALL_DIR\tools.
  4. Install OpenSSL x32. I assume you'll use default path "C:\Program Files (x86)\OpenSSL-Win32".
  5. Launch Qt Creator, select menu "Edit\Preferences" and on each tab manually add debugger (optional), compiler (mandatory), Qt version (mandatory) and finally a kit (mandatory).
  6. Open the project, set the kit for it, and modify under Buil Environment the PATH variable by adding path to OpenSSL binaries to it, i.e. "C:\Program Files (x86)\OpenSSL-Win32\bin". You can always change these settings by selecting Project button on the left pan of Qt Creator
This is usually enough to successfully build FastECU.
Ben78
Newbie
Posts: 4
Joined: Fri Feb 21, 2025 1:29 am

Re: Building from source

Post by Ben78 »

Excellent, thank you - it took me a few iterations but eventually got there. Below is a log of actions I specifically took to achieve a compiled "FastECU.exe" both for my future reference, and if anyone else faces a similar struggle to myself.

What I have done

Install Qt from qt-online-installer-windows-x64-4.8.1.exe - unable to locate an x86 specific installer.

Generic Desktop installation to Qt 6.8 selected

Qt install directory is C:/Qt

Download alesv files "qt_5.15.16_x32_static.7z" and "winlibs-i686-posix-dwarf-gcc-8.5.0-mingw-w64-9.0.0-r1.7z"
Extracted
Contents "5.15.16_x32" of "qt_5.15.16_x32_static.7z" copied to C:\Qt\5.15.16_x32 (dir)
Contents "mingw32" of "winlibs-i686-posix-dwarf-gcc-8.5.0-mingw-w64-9.0.0-r1.7z" copied to C:\Qt\tools\mingw32 (dir)

Downloaded OpenSSL x32 file "Win32OpenSSL-3_4_1.exe" from https://slproweb.com/products/Win32OpenSSL.html
Ran installer
Changed to C:\OpenSSL-Win32 as install directory
Question asked
"Copy OpenSSL DLLs to:
"The OpenSSL binaries (/bin) directory"
#seemed to make more sense here...
Next,Install

Opened Qt Creator > Edit, Preferences. First open option is 'Kits'
'Kits' has tabs 'Kits', 'Qt Versions', 'Compilers', 'Debuggers'

Debugger - not set
Compiler - Add MinGW and set to i686-w64-mingw32-gcc with path C:\Qt\Tools\mingw32\bin\i686-w64-mingw32-gcc.exe - This auto set the C++ compiler path (g++)
Qt Versions - set to Qt %{Qt:Version} (5.15.16_x32) with path C:\Qt\5.15.16_x32\bin\qmake.exe (Path is set not the Name)
Has warning No QML utility installed generating a ! warning icon
Kits - Set Compiler to MinGW, Qt Version to 5.15.16
Apply, OK

Configure project with the Kit as above
Update Environment Path variable with "C:\OpenSSL-Win32\bin;"
FastECU.pro - changed line 31 to reflect my OpenSSL-Win32 install location.

Run
Error
C:\Qt\5.15.16_x32\lib\libqtmain.a -L"C:\Program Files (x86)\OpenSSL-Win32\bin" -lshell32
c:/qt/tools/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.5.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lcrypto-3
Copied OpenSSL-Win32 dir to C:\Program Files (x86)\
Run
Compile complete, Fast ECU starts errors due to no ecu def/logger def (as expected though)

I will need to fix up my path in FastECU.pro but other than that I now have a complied exe.

Thank you so much, I think my understanding now is that a codebase is written for a specific compiler and qmake version, and generally will need to adhere to that environment in order to successfully compile?

I do have 356 marked "issues". mostly unused variables etc, is this due to me using a slightly incorrect version of something? Or is it just how it is?
MiikaS
Administrator
Posts: 973
Joined: Sat Jul 04, 2020 7:13 pm
Location: Mikkeli, Finland

Re: Building from source

Post by MiikaS »

Ben78 wrote: Sun Feb 23, 2025 6:10 am I do have 356 marked "issues". mostly unused variables etc, is this due to me using a slightly incorrect version of something? Or is it just how it is?
It is just how it is :) those unused variables are just left because code changes etc., maybe some day clean them away but not prio one now. I usually just disable it not to show warnings on Issues tab by unchecking the yellow triangle warning button.
Ben78
Newbie
Posts: 4
Joined: Fri Feb 21, 2025 1:29 am

Re: Building from source

Post by Ben78 »

Ah cool, I'll do that.

Can I ask, in the Beta.5 exe posted at Romraider the other day, all of the qDebug() content was posted to the syslogs. I can't find any log level switches, or anything else that will push qDebug messages into write_syslog. Is that in a version not posted to github?
Zombie47
Newbie
Posts: 33
Joined: Thu Oct 30, 2025 12:02 am

Re: Building from source

Post by Zombie47 »

Ben78 wrote: Sun Feb 23, 2025 11:12 am Ah cool, I'll do that.

Can I ask, in the Beta.5 exe posted at Romraider the other day, all of the qDebug() content was posted to the syslogs. I can't find any log level switches, or anything else that will push qDebug messages into write_syslog. Is that in a version not posted to github?
Hi, have you found 32-bit versions of QT? I tried building from source, but when I use Tatrix, I get the message:
"[2025-10-29 23:10:32.309] (DD) Testing for op20pt32.dll"
"[2025-10-29 23:10:32.310] (DD) op20pt32.dll not found"
"[2025-10-29 23:10:32.310] (DD) Tested installed drivers: 1"
"[2025-10-29 23:10:32.310] (DD) Testing for C:\\Windows\\SysWOW64\\op20pt32.dll"
"[2025-10-29 23:10:32.310] (DD) C:\\Windows\\SysWOW64\\op20pt32.dll not found"
"[2025-10-29 23:10:32.310] (DD) Tested installed drivers: 1"
"[2025-10-29 23:10:32.310] (DD) Initializing interface failed!"
"[2025-10-29 23:10:32.310] (DD) Testing j2534 interface, please wait..."
"[2025-10-29 23:10:32.310] (EE) INIT: Can't load J2534 DLL."
"[2025-10-29 23:10:32.310] (DD) J2534: Failed to open interface!"
I've concluded that the problem is that my QT is 64-bit.
alesv
Hero Member
Posts: 551
Joined: Mon Jul 15, 2024 3:23 pm

Re: Building from source

Post by alesv »

Zombie47 wrote: Thu Oct 30, 2025 12:11 am Hi, have you found 32-bit versions of QT? I tried building from source, but when I use Tatrix, I get the message:
Recent x32 toolchain is here. Here are the instructions.
Zombie47
Newbie
Posts: 33
Joined: Thu Oct 30, 2025 12:02 am

Re: Building from source

Post by Zombie47 »

Thank you! Sorry, I can't read English fluently. That's why I skipped it.
Post Reply