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

163 views
Skip to first unread message

marcop...@gmail.com

unread,
Sep 4, 2025, 3:27:59 PM (3 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 (3 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 (3 days ago) Sep 4
to harbou...@googlegroups.com

gfil...@gmail.com

unread,
Sep 5, 2025, 3:41:21 AM (2 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 (2 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 (2 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.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages