Best C Compiler for Building Harbour: MinGW or Visual Studio?

219 views
Skip to first unread message

marcop...@gmail.com

unread,
Sep 4, 2025, 3:27:59 PM (4 days ago) Sep 4
to Harbour Users

I’m currently compiling Harbour and I’d like to know which C compiler is considered the best choice for this purpose. Should I use MinGW or Microsoft Visual Studio (MSVC)?

Are there specific advantages, such as performance, compatibility, or ease of setup, that make one preferable over the other when building Harbour on Windows?

Thanks to advance,

Angel Pais

unread,
Sep 4, 2025, 5:48:07 PM (4 days ago) Sep 4
to harbou...@googlegroups.com
for Windows: MSVC

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/e546eb24-a693-40fd-b798-2339c536f7fan%40googlegroups.com.

john s wolter

unread,
Sep 4, 2025, 7:07:41 PM (4 days ago) Sep 4
to harbou...@googlegroups.com

gfil...@gmail.com

unread,
Sep 5, 2025, 3:41:21 AM (4 days ago) Sep 5
to Harbour Users
Dear Marco,

MSVC generally produces faster binaries than MinGW when building Harbour applications on Windows, especially for CPU-intensive or math-heavy tasks. However, results may vary depending on the specifics of the codebase and libraries used.

Benchmark and Runtime Speed

MSVC: Tends to generate smaller and faster executables, with well-optimized runtime libraries for Windows.

Binaries compiled with MSVC have demonstrated 30–50% better execution speed in benchmarks involving mathematical calculations and floating-point operations.

MSVC's optimized linking with modern Windows runtime libraries can offer improved performance, especially in threading and file I/O.

MinGW: May exhibit slower performance in some mathematical operations due to reliance on older Windows runtime libraries (msvcrt.dll), which are less optimized than their MSVC counterparts.

Thread handling and advanced logic operations may also be less efficient, leading to observable slowdowns in multi-threaded applications or complex data processing.

For standard Harbour GUI/database apps with modest computation, the performance difference is often minor.

Build Times and Binary Size

MSVC: Offers quicker build times due to better incremental compilation and efficient optimization algorithms.

MinGW: Compilation itself is usually slower and resulting binaries can be larger, though not dramatically so.

Summary Table

| Aspect           | MSVC                 | MinGW                |
|------------------|----------------------|----------------------|
| Binary speed     | Faster               | Slower in math/thread|
| Binary size      | Smaller              | Slightly larger      |
| Build time       | Faster               | Slower               |
| Threading        | Optimized            | Less optimized       |
| Math runtime     | Modern, fast         | Relies on legacy     |


For the best overall performance, MSVC is recommended for Harbour applications, though MinGW remains adequate for typical business or GUI applications without heavy computation.

Hope this is helpful.

Regards,
Grigory Filatov

четверг, 4 сентября 2025 г. в 21:27:59 UTC+2, marcop...@gmail.com:

marcop...@gmail.com

unread,
Sep 5, 2025, 6:41:34 AM (4 days ago) Sep 5
to Harbour Users
Thanks to all, i will change my c compiler to MSVC.

José M. C. Quintas

unread,
Sep 5, 2025, 9:02:35 AM (3 days ago) Sep 5
to harbou...@googlegroups.com

Not sure if MSVC continues depending of C run-time 

windows have the C run-time version, but it is not the same for all windows versions.

It was needed to install run-time, when version is not the same available on windows.


José M. C. Quintas

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted

davi...@aldeiadigital.com

unread,
3:09 AM (16 hours ago) 3:09 AM
to Harbour Users
I use MSVC. On the Windows platform, I see no reason to use anything else.

I use MSVC. On the Windows platform, I see no reason to use anything else.

john s wolter

unread,
3:09 AM (16 hours ago) 3:09 AM
to harbou...@googlegroups.com

Interesting discussion about CRT AND UCRT.  It's information I didn't know.   Now I'm going to have to learn all the run times for all the different Zig Platforms and targets.

Correction :  Zig home : https://ziglang.org/
-Zig Cross Platforms & Targets : https://en.wikipedia.org/wiki/Zig_(programming_language)#Version
- Google Search "Zig programming"  : https://www.google.com/search?q=Zig+programming
- Google AI Search "Zig programming"  : Long URL 

- Zig may likely qualify as a more universal development environment post Harbour C/C++code generation.  The details are always a challenge.  Are the included C/C++ compatible with Harbour's compiled output?  Is there a guide to adapting compilers?  Comparing other compilers will give some insight.

- The build system uses the Zig language.  Webassembly, wasm, is included but how? 

Cheers, John S Wolter


On Fri, Sep 5, 2025 at 9:41 PM Itamar Lins <itama...@gmail.com> wrote:
Hi!
> MinGW: May exhibit slower performance in some mathematical operations due to reliance on older Windows runtime libraries (msvcrt.dll), which are less optimized than their MSVC counterparts.
Not true.
The Universal CRT (UCRT) is a Microsoft Windows operating system component. It's included as part of the operating system in Windows 10 or later, and Windows Server 2016 or later. 
New version of Mingw runs UCRT... etc., etc. It's Harbour's default compiler.
Avoid those people who believe Windows is the only operating system.
Nothing stated without proper testing is pure nonsense.
According to any AI, Mingw stands out as the best because it's cross-platform.
The speed and size of our executables aren't the most important factors because they're imperceptible.

Best regards,
Itamar M. Lins Jr.
Em sexta-feira, 5 de setembro de 2025 às 10:02:35 UTC-3, José M. C. Quintas escreveu:

Mario H. Sabado

unread,
4:26 AM (15 hours ago) 4:26 AM
to harbou...@googlegroups.com
Hi John,

Very interesting info.  I think they have just dropped their latest dev release (0.16) with a refined implementation of  ASYNC / AWAIT.  The Ring creator (Mahmoud) had initial support for the Zig compiler and I was able to build the Ring source interchangeably between MSVC and Zig.  Although the C/C++ compilation process for Zig takes a parameter (i.e, zig cc), I don't know how to  incorporate this in the current Harbour build system (hbmk2). 

Best regards,
Mario

Reply all
Reply to author
Forward
0 new messages