Actual C compiler for Windows for free - Page 1
Forum section: electronics / general

author: Picuino
author_rank: Super Contributor
timestamp: October 31, 2021, 09:56:19 am
content: I don't use the c language much to program on the PC (Windows). Now I have considered updating my old compilers and I don't know what open or free software options exist.Any advice?

author: Dubbie
author_rank: Unknown
timestamp: October 31, 2021, 10:07:47 am
content: GCC?

author: DC1MC
author_rank: Super Contributor
timestamp: October 31, 2021, 10:15:26 am
content: Visual Studio Community Edition if you want it for windows ->https://visualstudio.microsoft.com/vs/community/

author: FlyingDutch
author_rank: Regular Contributor
timestamp: October 31, 2021, 10:17:24 am
content: hello,"Visual Studio Comunity" is free software. As one of it's compilers you can install C++ compiler.Best regards

author: Picuino
author_rank: Super Contributor
timestamp: October 31, 2021, 10:24:57 am
content: Quote from: Dubbie on October 31, 2021, 10:07:47 amGood for command line. I have an old version of GCC 3.45 from MinGW. What is the newest one? Cygwin perhaps?Quote from: DC1MC on October 31, 2021, 10:15:26 amGood for Windows GUI. Downloading. Thanks

author: daqq
author_rank: Super Contributor
timestamp: October 31, 2021, 10:48:01 am
content: I use CodeBlocks as a whole package - straighforward, no nonsense single download.

author: Karel
author_rank: Super Contributor
timestamp: October 31, 2021, 11:03:41 am
content: https://www.mingw-w64.org/

author: Picuino
author_rank: Super Contributor
timestamp: October 31, 2021, 11:21:15 am
content: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download

author: newbrain
author_rank: Super Contributor
timestamp: October 31, 2021, 03:45:58 pm
content: Visual Studio Community is a very powerful, complete and free as in beer IDE - I happen to like it a lot - make sure to comply to the license requirements, if you intend to use it at work: at home, or < 5 employees you should be fine (IANAL, TINLA).The quality and standard conformance of the Microsoft C/C++ compiler has improved a lot in recent years, though, for the latter, there are no standard C89 or C99 conforming modes (only C11 or C17).Another fine alternative is LLVM/clang, free as in Apache licensed and with an MS C compiler mode (at least, same options). I used VS to compile it.

author: TheCalligrapher
author_rank: Regular Contributor
timestamp: October 31, 2021, 04:01:22 pm
content: C compiler that comes with Microsoft Visual Studio.It has always been an excellent C89/90 compiler (aside from some ridiculous preprocessor problems). By VS2017 they fixed their preprocessor issues and added almost full C99 support as a "langauge extension". In VS2019 we finally get focused and dedicated support for modern C standards.Still no VLA though

author: paf
author_rank: Regular Contributor
timestamp: October 31, 2021, 04:31:35 pm
content: Are you sure you want VLA in C?https://blog.joren.ga/vla-bad

author: TheCalligrapher
author_rank: Regular Contributor
timestamp: October 31, 2021, 04:51:36 pm
content: Quote from: paf on October 31, 2021, 04:31:35 pmYes, I am. VLA is an extremely valuable feature.Quote from: paf on October 31, 2021, 04:31:35 pmThe person who wrote that completely missed the point of what VLA is and what they are for. As many people who don't understand the purpose of VLA, the author focused on the matter of stack-allocated VLA and problems associated with stack-allocated VLA. These concerns are perfectly valid, but in reality, this is a completely secondary and insignificant matter, which does not really have much to do with the proper usage of VLA.VLA does need to be stack-allocated. And (more importantly!) an array does not have to be a VLA for you to work with it through VLA interface. These two points immediately slam-dunk invalidate all reasoning presented at that link. The author apparently knew that, since later in that post they kinda "touch" the usage patterns that reveal the true value of VLA, but seeing that it basically derails their previous arguments, the author attempts to weasel out of the situation by referring to such bogus problems as "breaking conventions"Here's my take on the matter:https://stackoverflow.com/a/54163435/187690

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 31, 2021, 05:06:07 pm
content: Quote from: Picuino on October 31, 2021, 10:24:57 amAll C compilers I know of are actually "command line". Even MSVC. Visual Studio just adds an IDE on top of the MS comand line tools, which, BTW, you can also install without Visual Studio IDE.Likewise, you can use a number of other free IDEs along with GCC. If you like the Visual Studio interface, you can use Visual Studio Code for instance.The latest GCC is 11.2. There's a number of ways to get it for Windows. If you were used to MinGW, you can just install MSYS2 and get it from there:https://www.msys2.org/You also have standalone installs here:https://www.winlibs.com/

author: newbrain
author_rank: Super Contributor
timestamp: October 31, 2021, 06:17:08 pm
content: Quote from: paf on October 31, 2021, 04:31:35 pmSorry, but the undefined behaviour in the very first example* immediately segfaulted my interest and I did not go further.That said, I'm also not a big friend of VLAs, though they might come handy in some cases I must say I never felt the need to use them.The official reason for MS not to implement them in their compiler is that they are seen as a vulnerable and easily abusable feature, akin to "gets()".* Use of an object with automatic storage duration whose value is as yet indeterminate.

author: newbrain
author_rank: Super Contributor
timestamp: October 31, 2021, 06:24:11 pm
content: Quote from: SiliconWizard on October 31, 2021, 05:06:07 pmTechnically correct (the best kind of correct).But since VS 2017 (IIRC) one cannot install them if they don't have a valid Visual Studio license.This means they have exactly the same license restrictions, and the only way to get a VS license is (AFAIK, and apart buying one of the professional packages) downloading VS Community.Not a change I like, but it is what it is (e.g: I cannot use them at work, as I don't have a VS license there).

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 31, 2021, 06:31:45 pm
content: Quote from: newbrain on October 31, 2021, 06:24:11 pmI don't know much about licensing. Just that you can install the command line tools for free, from the VS installer (Visual Studio Build Tools 2019). Downloaded the installer itself for VS Community - but I'm not aware of those tools being at all different from the licensed VS build tools. Possibly you can only use them as per the VC Community license, but they are otherwise just the same.Do you mean that the build tools once could be used for free without licensing restrictions before 2017? Then that's what would have changed. But if, as seems to be the case for the OP, only uses this as hobby tools (they can correct me if I'm wrong here), it won't make a difference.That said, in that case, I would certainly use GCC and ditch VS tools.

author: newbrain
author_rank: Super Contributor
timestamp: October 31, 2021, 06:38:45 pm
content: Quote from: SiliconWizard on October 31, 2021, 06:31:45 pmAs mentioned, I'm not so sure about the VS revision that brought the change, but, yes, their license was much more liberal before (as much that I had no qualms installing them at work, and I amverycareful about these issues).

author: Jeroen3
author_rank: Super Contributor
timestamp: October 31, 2021, 07:06:03 pm
content: You can install mingw, it's an option when installing Qt community edition as well.If you install Qt with mingw, you can also do plain C programs without any of the gpl problems Qt brings to the table. Using the IDE is free.It uses cmake as build system.

author: emece67
author_rank: Frequent Contributor
timestamp: October 31, 2021, 07:40:36 pm
content: .

author: udok
author_rank: Regular Contributor
timestamp: October 31, 2021, 09:11:23 pm
content: Quote from: SiliconWizard on October 31, 2021, 06:31:45 pmBad choice under Windows. GCC ist not 100% compatible to the MS DLLs (exceptions handling!).Much better choice is clang-cl, but the MS cl compiler produces very good code.

author: TheCalligrapher
author_rank: Regular Contributor
timestamp: October 31, 2021, 10:46:17 pm
content: Quote from: SiliconWizard on October 31, 2021, 06:31:45 pmGCC is a definitive loser at this point. Microsoft and Clang are leading the way with a gap that some might refer to as exponential. Come to think of it, GCC has always been intended as a mere "legacy code" compiler, but previosuly they at least managed to find some time and resources to keep up with the language. But not anymore apparently.It might also be important to keep in mind, that regardless of what the target platform is, today 90-95% of the actual everyday application develoment is done in Visual Studio under Windows. Everything else is used as a final-stage integration and QA tools. Nobodydevelopswith GCC, if we ignore statistical noise.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: October 31, 2021, 10:58:40 pm
content: Quote from: newbrain on October 31, 2021, 03:45:58 pmI have used Visual Studio for about 20 years.Generally works very well.Microsoft do sometimes drop a clanger with it.The buggers removed C++ winforms and left me high and dry.There was an uproar and they eventually put it back in.I do a bit of web development with it.Some of my websites are quite big so being allowed to just update one or two files is great.Went to do it one day and the option had been removed ! so 10 minutes to upload whole website ! instead of 10 seconds for 2 files.I complained about it and they put it back in.Since then it has been removed 3 times and 3 times put back in ! communication inside Microsoft isnt good at times if it keeps getting removed.

author: Nominal Animal
author_rank: Super Contributor
timestamp: October 31, 2021, 11:57:51 pm
content: Quote from: TheCalligrapher on October 31, 2021, 10:46:17 pmReally? What ass did you pull that assumption from?I'll grant you Windows application development and phone apps (Android and iOS) is done in Visual Studio under Windows, but that's it.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 01, 2021, 12:35:54 am
content: Quote from: Nominal Animal on October 31, 2021, 11:57:51 pmSame remarks.

author: Karel
author_rank: Super Contributor
timestamp: November 01, 2021, 08:29:41 am
content: Quote from: Jeroen3 on October 31, 2021, 07:06:03 pmWhat are you talking about? Since when Qt brings gpl problems to the table?The opensource edition of Qt is LGPL licensed which means you can freely use it in all kind of programs includingclosed source and commercial programs without the need for an additional license or to pay a fee.The only exceptions are: when linking static with the Qt libs and/or when you modify the Qt libs.In the latter case, it suffice to opensource only the modifications of the Qt libs.

author: Karel
author_rank: Super Contributor
timestamp: November 01, 2021, 11:47:11 am
content: Quote from: udok on November 01, 2021, 11:41:53 amYou are wrong.Again, the opensource edition of Qt is LGPL licensed.All software that is LGPL licensed can be used to make a living from your work. Period.

author: udok
author_rank: Regular Contributor
timestamp: November 01, 2021, 11:49:54 am
content: Quote from: Karel on November 01, 2021, 08:29:41 amIf you want to make a living from your work, you need a commerical license.You can only distribute your App, if you have a valid license subscription.Over 4500$ for each developer and a one year subscription!https://www.qt.io/pricing

author: Karel
author_rank: Super Contributor
timestamp: November 01, 2021, 11:59:03 am
content: You are NOT obliged to buy a commercial license. The Qt Company just wants to give you that impression.You can use Qt in commercial closed source applications without the need for a commercial license, as long as you don't link static.The Qt company is free to ask money for a commercial license.You are free not to buy the commercial license and to use the opensource edition of Qt in commercial closed source software.Don't believe their b*llsh*t.edit:https://softwareengineering.stackexchange.com/questions/47323/can-i-use-an-lgpl-licenced-library-in-my-commercial-apphttps://www.gnu.org/licenses/why-not-lgpl.html

author: paf
author_rank: Regular Contributor
timestamp: November 01, 2021, 12:32:08 pm
content: About VLAs (and other stuff) a good reference is:https://gustedt.gitlabpages.inria.fr/modern-c/And please remember that VLAs are an optional feature in C11. Yu should test if your compiler has it before using it.

author: newbrain
author_rank: Super Contributor
timestamp: November 01, 2021, 12:37:44 pm
content: Quote from: Karel on November 01, 2021, 11:59:03 amTo be honest, there is very little bullshit on the Qt site.They repeatedly state (in various forms, this is taken from the FAQ, emphasis mine):QuoteThe only point they get (probably unintentionally) slightly wrong is:QuoteOnthis page.Specifically LGPLv3 gives an explicit exemption of section 3 of GPL, the one about DRM.Moreover, there's a nice page which (correctly AFAICS) details the obligations of the various FOSS license (LGPLv3 GPLv2, GPLv3) used:https://www.qt.io/licensing/open-source-lgpl-obligationsDisclaimer: IANAL, TINLA - consult aspecializedlawyer.But I've worked for many years as an internal FOSS product owner, and as a go-to person (before legal, which is always needed) for FOSS licensing.BTW, the product was LGPL, and we were both heavily contributing and making money by using it.EtA: GPL, in its various incarnations especially the v3 ones, is a very complicated license. For this reasons it's widely misunderstood (even by many FOSS supporters). Sometimes the "peace of mind" of getting a commercial license can seem attractive, one gets some features more (as for Qt) and the cost might be reasonable or completely inconsequential depending of the volume of affairs.

author: newbrain
author_rank: Super Contributor
timestamp: November 01, 2021, 12:58:09 pm
content: Quote from: paf on November 01, 2021, 12:32:08 pmThat's one of the reasons MS compiler does not declare C99 compliance, but does (better, and with explicit command line support) with C11/C17.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 01, 2021, 05:17:48 pm
content: Quote from: newbrain on October 31, 2021, 06:17:08 pmYeah, most of this blog's rant is just very silly.Sure stack space is limited - default is usually 2 MBytes on both Windows and Linux (Edit: on Linux, it depends - on my machines, it's 8 Mbytes). Just allocate a very big object on the stack, and it will just spectacularly crash in the same way. No need for VLAs here.Code:int main(void){double ThisWontEndWell;...return 0;}Of course when using VLAs, you should always check that the size will be under some predefined bound before declaring the array. That's common sense.Now I admit I never use VLAs, but I can see in which situations they could come in handy, and even save stack space - it just allows to allocate the minimum amount you need in a given function call instead of allocating a fixed size (which would be the largest you need). And no, dynamic allocation is not the answer to everything here: it's usually a lot less efficient, and for small objects which only live within a given function, it often doesn't make sense.Like most other C features, it can have its own risks. Use it accordingly. Yes VLAs can be risky in the hands of beginners. Experienced programmers should have no problem using them properly.As to MS not supporting them, frankly MS compilers have been notorious not to be fully compliant to the C standard, in particular starting with C99. VLAs are not the only thing missing. Shipping a compiler that is not fully compliant to the standard for alleged security reasons is stupid. If that is even the rationale, which I'm not even sure here.

author: Karel
author_rank: Super Contributor
timestamp: November 01, 2021, 08:05:43 pm
content: Quote from: newbrain on November 01, 2021, 12:37:44 pmYou are right, I exaggerated there. But I still stand with my other points about LGPL'ed libraries & closed source software.

author: Karel
author_rank: Super Contributor
timestamp: November 01, 2021, 08:22:19 pm
content: “Open Source Qt” shall mean the non-commercial Qt computer software products, licensed under the terms of the GNU LesserGeneral Public License, version 2.1 or later (“LGPL”) or the GNU General Public License, version 2.0 or later (“GPL”). For clarity,Open Source Qt shall not be provided nor governed under this Agreement.https://www.qt.io/terms-conditions/What The Qt company calls "non-commercial", can be used perfectly fine in closed source commercial software as longas it (the Qt libraries) is licenced under the LGPL license and not statically linked.Think about this: if LGPL'ed libraries couldn't be used by closed source (commercial) programs, then they couldn'tuse, for example, printf() provided by glibc on Linux.

author: newbrain
author_rank: Super Contributor
timestamp: November 01, 2021, 11:47:56 pm
content: Quote from: Karel on November 01, 2021, 08:22:19 pmYou don't need to convince me: my point was only that the site has quite clear indications of the various license regimens, and does not try to hide the FOSS ones.I'm 100% aware and convinced that LGPL can be dynamically (or in equivalent ways) integrated in proprietary software, see my own words below:Quote from: newbrain on November 01, 2021, 12:37:44 pmMaybe I should have added "...using it in our proprietary SW".

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 01, 2021, 11:51:52 pm
content: Quote from: udok on November 01, 2021, 11:49:54 amNo. This has been discussed before, but heck, why not, let's repeat.If you use the LGPL-licensed (License mode: LGPL v3)Qt, and dynamically link your project against those unmodified libraries, you do not require a commercial license, and you do not need to pay a cent to anybody, and your own code is yours, free to sell or distribute as you wish.Here is how you, as a proprietary software vendor, can trivially fulfill the LGPL requirements. There are other options, but this set is basically bulletproof and exactly what the Qt developers want, so if you ever find yourself targeted, you can simply ask the copyright owners (Qt developers) a statement you're not breaking their copyrights; and complying in the following way is likely to make the copyright owners happy to help.Provide the exact sources for the Qt libraries you use, for every version you distribute or have distributed, as freely downloadable files.Include theconfigureconfiguration you used to build the binaries, and the exact compiler and compiler version used, so that anyone interested can trivially replicate the exact same binaries. This can be useful for certain infosec reasons as well (if tainted binaries are suspected). All this incurs zero risk, and costs you almost nothing to provide these, even if not explicitly required by the LGPL. This is how you garner goodwill among both users and developers, really.Use dynamic linking to use the Qt libraries. This is automatic if you use Python; in C and C++ you just compile normally, not statically, so your binaries will refer to the libraries in separate files. This is important, because it is the standard accepted way you explicitly show non-derivative-ness when using LGPL'd libraries. Since this is the standard practice anyway, the cost of this is zero.In your user-visible documentation, proudly mention you use LGPL-licensed Qt  libraries, and provide a link to where you provide the exact sources (and configuration needed to replicate the binaries). Qt is a brand, and proudly proclaiming its use is taking advantage of the brand visibility; and you'll make the Qt developers happy too.To obtain the sources to the Qt libraries, go to the Qt site, and scroll to the bottom of the page. Near the bottom right corner, under "Community", pick the "Downloads" link. On that page, in the "Downloads for Open Source users" block, click the "Go open source" link. For the sources, on the following pages that continue to scare you away from open source to the commercial licenses, you'll finally end up athttps://code.qt.io/, with build/compile instructions at[url=https://wiki.qt.io/Building_Qt_5_from_Git]https://wiki.qt.io/Building_Qt_5_from_Git. These two pages are the ones you need to bookmark, as you'll often return there, and going through the Qt site is a pain.Or, you can just grab e.g. the entire Qt 5.15 long-term release (latest as of 2021-11-01) via git command-line utilities:git clonehttps://code.qt.io/qt/qt5.gitcd qt5git checkout 5.15You'll need Perl, Python, and a C++ compiler; seeBuilding_Qt_5_from_Gitfor details.The Qt 5.12.11 long-term release binaries (application development Qt libraries and the Qt Creator tool) are available asoffline installers(also grab the sources for them on the same page!), if you don't want or cannot compile the binaries you want/need with your own application.That's it.Now, although the Qt libraries needed for application development, Qt Creator (including Qt Designer for UI design), and even PySide2 (if you want Python bindings too) are all LGPL-licensed, you do want to verify the license for the modules you need. In particular, for Qt 5, you can consultdoc.qt.io/qt-5/licensing.htmlanddoc.qt.io/qt-5/qtmodules.html: Qt Essentials (QtCore, QtGui, QtWidgets, QtMultimedia, QtMultimediaWidgets, QtNetwork, QtSql, etc.) are all LGPL-licensed, and so are most add-on modules (Qt3D, QtConcurrent, QtBluetooth, QtGamepad, QtHelp, QtImageFormats, QtLocation, QtOpengl, QtPrintSupport, QtRemoteObjects, QtSerialPort, QtSerialBus (CAN, Modbus), QtSpeech, QtSVG, QtUiTools, QtWebChannel, QtWebEngine, QtWebSockets, QtWebView). Modules listed under "Add-ons available under Commercial Licenses, or GNU General Public License v3", like QtCharts and so on, are NOT LGPL-licensed, so those you cannot include in your proprietary projects. Similarly, "Value-add modules" like "Qt for Device Creation" and "Qt for MCUs" require a commercial license, and are NOT LGPL-licensed.BecausePython is licensed under the zero-clause BSD license, it is perfectly legal and allowed, even encouraged by the developers, to create a proprietary application that uses the Python interpreter for a permissively licensed UI (granting users permission to modify the UI and pass those changes on to other users), Qt libraries (dynamically linked, used under the LGPL license), and proprietary C and/or C++ libraries (containing the secret application magick). While it sounds like a mess, in some cases this has the best of all worlds: keeps the nitty-gritty details that users cannot and should not really mess with and makes the application stand apart from competitors completely proprietary, leverages known existing LGPL libraries for the UI functionality, but lets the end users fix any niggling issues with the UI itself with permission (but obviously no guarantees after modifications have been done!) from the vendor. This kind of complete control over the UI is extremely powerful, and may open up completely new, customized uses, for institutional/company clients, while still keeping all licensing issues clear.It's not difficult to achieve, neither legally nor technically, if properly designed from the get go, instead of just aggregating something together first and then checking how to make it legally/safely distributable.

author: Karel
author_rank: Super Contributor
timestamp: November 02, 2021, 07:20:36 am
content: Quote from: newbrain on November 01, 2021, 11:47:56 pmIt was a reaction to udok who is under the impression that you are obliged to buy a commercial Qt license if you wantto commercially use Qt in closed source programs.The reason that I want to rectify this, is because this discussion pops up every now and then. I believe this is partly causedby the way the Qt Company communicates about this matter.In the past, the open source edition of Qt was GPL licensed, not LGPL. That was a different situation and perhapsthis is contributing to the confusion as well after they changed it to the LGPL.

author: udok
author_rank: Regular Contributor
timestamp: November 02, 2021, 11:04:28 am
content: Quote from: Karel on November 02, 2021, 07:20:36 amOK, i had this impression from the Qt Website.But why do they then provide commercial licenses, and not cheap ones for 4500$ / Year / Developer.Maybe it is because any larger project will have a need to modify the Qt sources?

author: Karel
author_rank: Super Contributor
timestamp: November 02, 2021, 12:10:55 pm
content: Quote from: udok on November 02, 2021, 11:04:28 amThe commercial edition of Qt adds the following (in respect to the opensource edition):- extra goodies/modules not avalaible under an opensource license.- precompiled libs (at least for windows) so no need to recompile everything after an update- updates for LTS releases, the opensource edition of a certain major version e.g 5.15.x stopped receiving updates when 6.0.0 was releasedPeople with a commercial license will still receive updates for 5.15.x- support: your bugreport will be handled faster if you are a paying customer

author: Jeroen3
author_rank: Super Contributor
timestamp: November 02, 2021, 02:48:06 pm
content: Quote from: Karel on November 01, 2021, 08:29:41 amSee the comments above.

author: Karel
author_rank: Super Contributor
timestamp: November 02, 2021, 04:27:51 pm
content: Quote from: Jeroen3 on November 02, 2021, 02:48:06 pmDo you really consider them problems?Either you pay for a commercial license or you compile the libraries yourself.Regarding the missing updates, you can find them in newer major release version.But even with these "problems", I find Qt, with all her defects, still the best cross-platform graphical toolkit and C++ framework available.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 02, 2021, 08:16:02 pm
content: If one wants to develop GUI applications in C as opposed to C++,Gtk+ 3is also LGPL-licensed. (So are its dependenciesGObject(andglib),Cairo,Pango,GDK, andAtk. Thehttps://docs.gtk.org/pages lists many of their licenses as GPL, but that is not exactly accurate: many are dual-licensed, and some use the older "GNU Library General Public License" form, which is still LGPL, not GPL.)A minimal example (with compile instructions for Linux and Mac OS; I don't have Windows, so I don't know the exact ones to use there):Code:// SPDX-License-Identifier: CC0-1.0/* Compile using for example* gcc -Wall -O2 `pkg-config --cflags gtk+-3.0` example.c `pkg-config --libs gtk+-3.0` -o example*/#include <gtk/gtk.h>static void main_activate(GtkApplication *app, gpointer data){GtkWidget *win;win = gtk_application_window_new(app);gtk_window_set_title(GTK_WINDOW(win), "Example");gtk_widget_show_all(win);}int main(int argc, char *argv[]){GtkApplication *app = gtk_application_new("com.eevblog.Example", G_APPLICATION_FLAGS_NONE);g_signal_connect(G_OBJECT(app), "activate", G_CALLBACK(main_activate), NULL);int status = g_application_run(G_APPLICATION(app), argc, argv);g_object_unref(G_OBJECT(app));return status;}User interfaces are inherently event-based, so it is natural to write even C code to conform to the event model, rather than requiring an imperative model (as is common for C programs). So there is a big paradigm difference in the entire approach, and that can feel jarring. Don't let yourself be put off by it; in this kind of use, the event-based model –– even if it looks odd/funny/funky for a C programmer! –– actually works really, really well.Note how uppercase macros (GTK_WINDOW(),G_OBJECT(),G_CALLBACK(),G_APPLICATION()) are used to access the variables in specific "roles". This is how GObjectprovidesclasses and inheritance in C, while still providing type checks. Don't consider them "casts", as that can lead to seeing them as unnecessary irritant in the coding style; consider them the way GObject provides multiple roles for each type (especially GtkWidget and its "derivatives"), according to the type hierarchy.One can use Glade to design the UI, saving it as a .glade file (XML format description of the widgets). These .glade files can then be realized easily using e.g.gtk_builder_new_from_file()(orgtk_builder_new_from_string()), associating callback names with functions usinggtk_builder_add_callback_symbol(), and connecting events with the named callbacks withgtk_builder_connect_signals(). One can even access individual objects described in the .glade, usinggtk_builder_get_object(). All of this is themeable using CSS, too.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 02, 2021, 08:42:03 pm
content: Note that GTK4 has been out for a while.GTK is not bad at all. (On Windows, the same compile line will work under MSYS2.)The UI looks a lot less like "native" UI on MacOS and Windows, which is one of the reasons it's frowned upon a bit on those platforms, but it does work reasonably well.One of the things that often ticks people off are the non-native common dialogs (such as File Open). But there's a way to have them using GTK.For instance, you have the 'GtkFileChooserNative'.

author: PlainName
author_rank: Super Contributor
timestamp: November 04, 2021, 12:42:01 pm
content: QuoteHate that. Prevents stuff like Listary and similar from working, so a massive productivity killer. In fact, sometimes I think about running such an app and then think forward to opening some file well down the directory tree and think, "Sod that, can't be arsed".

author: Karel
author_rank: Super Contributor
timestamp: November 04, 2021, 01:27:58 pm
content: QFileDialog Class:By default, a platform-native file dialog will be used if the platform has one.https://doc.qt.io/qt-5/qfiledialog.htmlApart from the native file chooser dialog, Qt has the best native look and feel when compared withother cross platform gui toolkits and frameworks.

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 05, 2021, 06:28:17 am
content: Quote from: Karel on November 04, 2021, 01:27:58 pmNo, that would bewxWidgets, because it uses native widgets if one exists, and only implements its own when there is no close-enough native one. See e.g.screenshots for 3.1.5(latest as of 2021-11-05) for the differences.It too has a native file selection dialog; so do Qt, GTK+, and FLTK, too, so nothing surprising. If an application uses a non-native File (Open/Save) dialog, it's the developers fault, and is easily fixable, in basically all applications, by using the proper dialog widget instead.

author: Karel
author_rank: Super Contributor
timestamp: November 05, 2021, 07:29:51 am
content: Let's agree we don't agreehttps://doc.qt.io/qt-5/gallery.html

author: PlainName
author_rank: Super Contributor
timestamp: November 05, 2021, 09:56:45 am
content: QuoteIt's nice to have dialogs that follow the native style (except, perhaps, the W10/11 white-on-white borderless annoyance), but looks is just skin deep. The importance of using the actual native dialogs is that the user can replace them with more appropriate ones, or even just inject hints, andeveryapp on the system will use those instead without the programmer needing to modify his product especially. Kind of like the reason for LGPL.Sorry if you're already aware of that, but you do seem to be banging on about looks. Function matters a lot more.

author: Karel
author_rank: Super Contributor
timestamp: November 05, 2021, 11:19:58 am
content: Quote from: dunkemhigh on November 05, 2021, 09:56:45 amActually, I agree with you. But it seems that a lot of people do care about it (they prefer to use software that have native look & feel).In other words, you can make (from a functionally point of view) the perfect software, but if users don't like the esthetics, they run away...

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 05, 2021, 02:05:19 pm
content: Quote from: Karel on November 05, 2021, 07:29:51 amOr let's agree that you're just wrong, because Qt is not native, it just implements its own widgets in a style thatlooks likethe default theme on each OS (possibly with limited OS theme emulation, I'm not sure), whereas wxWidgetsarethe native widgets.What you showed is thatby default, Qt provides a preferred look-and-feel on different OSes. That I could agree with, I guess.Native widgets start to matter a lot when we start using stuff like screen readers and Braille displays and such. If the widgets are native, and the OS supports those devices, then everything Just Works. If the widgets are self-implemented, and only emulate a "native look and feel", it means those devices won't work unless the widget toolkit has special support for the devices. Usually they don't.wxWidgets uses the native widgets for all widgets that do have native implementation, so although the default wxWidgets "looks" may be plainer/uglier than typical, the widgets are genuine, and therefore all those screen readers and special displays just work.This can seem like nitpicking or semantics, but "native" is an important concept here.We could argue whether "native look and feel" implies native implementation (as I believe it does), or whether it allows emulation (which I do not believe it does, because if it did, then the word "native" would be just a synonym of 'expected' or 'typical').

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 05, 2021, 06:29:32 pm
content: wxWidgets is IMO the closest to looking "native" than most other cross-platform libraries, and the licensing is nicer (again IMO) than Qt's. And as Nominal pointed out, it's not just looking native but actually uses the native common dialogs and widgets when available.Although looking close to native, Qt is different as Nominal said, and Qt apps are IME very recognizable. I can spot that an app uses Qt in a couple seconds.

author: 77algernon
author_rank: Newbie
timestamp: November 16, 2021, 10:02:27 am
content: To OP: You may try Pelles C Compiler, a complete C compiler/IDE/toolkit, in under 15 MBytes =)http://www.smorgasbordet.com/pellesc/

author: rstofer
author_rank: Super Contributor
timestamp: December 01, 2021, 07:24:41 pm
content: Quote from: SiliconWizard on October 31, 2021, 05:06:07 pmVisual Studio can print your source files, Visual Studio Code can not. I like VS Code, I use it all the time but I really hate having to open the file with another editor just to get a listing.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 01, 2021, 07:42:47 pm
content: Quote from: rstofer on December 01, 2021, 07:24:41 pmAh, that's funny. I have VS Codium - mainly installed it to evaluate it, and occasionally to get a GUI frontend for GDB - it has an extension for that - but otherwise, I don't use it. Just checked and you're right, it doesn't support printing. Must be one of the few IDEs I've seen that did not!

author: cfbsoftware
author_rank: Regular Contributor
timestamp: December 01, 2021, 10:22:15 pm
content: Quote from: rstofer on December 01, 2021, 07:24:41 pmIf it's any consolation you are not alone:https://github.com/Microsoft/vscode/issues/5953

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 01, 2021, 11:15:12 pm
content: Quote from: cfbsoftware on December 01, 2021, 10:22:15 pmWow, it's over 5 years old. And still nothing. Guess MS does not care one bit. Or maybe they want to keep this feature strictly as a differentiator for Visual Studio.Note that VS Codium does not have printing either. But as far as I've understood, VS Codium is not really a fork, so it doesn't add any feature to VS Code. It's mainly a *build* that just strips off the nasty stuff (telemetry...) but otherwise uses the same code base.

author: PlainName
author_rank: Super Contributor
timestamp: December 01, 2021, 11:23:49 pm
content: QuoteThought that would be worth a look, but on Windows it uses Chocolaty or Scoop for install, both of which make Microsoft look sensible.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 01, 2021, 11:42:51 pm
content: Quote from: dunkemhigh on December 01, 2021, 11:23:49 pmIt doesn't need any install. You can download the binaries directly and run it without installation. That's what I do.Just pick the .zip file of your choice here:https://github.com/VSCodium/vscodium/releases(latest is VSCodium-win32-x64-1.62.3.zip for Windows/x64)

author: PlainName
author_rank: Super Contributor
timestamp: December 02, 2021, 12:27:06 am
content: QuoteBlinding, thanksDunno how I missed that. Probably too dazzled by the pretty web page

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 02, 2021, 01:15:23 am
content: Quote from: dunkemhigh on December 02, 2021, 12:27:06 amYes, the web site is not the best. But it explains the difference with VS Code, including license differences...Note that (probably also for licensing reasons), some VS Code extensions are not accessible in VS Codium. But you should find equivalent extensions that will work with it. Was the case for the extension supporting GDB debugging.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: December 13, 2021, 01:26:57 pm
content: I use visual studio

author: PlainName
author_rank: Super Contributor
timestamp: December 13, 2021, 03:17:49 pm
content: The thing Visual Studio (even the proper full fat one) doesn't have, which I find so useful it's the other primary feature all my code editors since Brief have had, is the preview window. This isn't the VS preview window that merely shows a file preview but a preview of whatever your cursor happens to be on. If it's a function call it will show the function definition. A variable, the declaration. A struct member, the structure declaration. Etc. Even if you're not using it to actually preview, it is so quick that you get used to it signalling that the thing you just typed actually exists. IOW, if you type a name and the preview window doesn't show the declaration, you've made a typo.The attached screeny gives a flavour. It's part of ESP32 example code, so the highlighted #define is actually defined somewhere within the 1GB of ESP-IDF source. Nevertheless, as soon as I click on it the preview window shows the definition - it is very rare that it doesn't update within a second. (Of course, this is in addition to the usual code hints and stuff.

author: Bassman59
author_rank: Super Contributor
timestamp: December 13, 2021, 09:00:10 pm
content: Quote from: SiliconWizard on December 01, 2021, 07:42:47 pmThe Atom developers also don't think that printing is important. Seehere, for example.

author: newbrain
author_rank: Super Contributor
timestamp: December 14, 2021, 10:36:30 am
content: I was trying to remember the very last time I felt the need to print code.It finally came to me it was 1993, with some Fortran running on a MicroVAX!I did not even notice VS Code was missing a print function, and I'm not able to tell whether e.g. Eclipse or Visual Studio do include one...