Author Topic: Actual C compiler for Windows for free  (Read 12463 times)

0 Members and 1 Guest are viewing this topic.

Online PicuinoTopic starter

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: 00
    • Picuino web
Actual C compiler for Windows for free
« on: October 31, 2021, 09:56:19 am »
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?
 

Offline Dubbie

  • Supporter
  • ****
  • Posts: 1114
  • Country: nz
Re: Actual C compiler for Windows for free
« Reply #1 on: October 31, 2021, 10:07:47 am »
GCC?
 

Offline DC1MC

  • Super Contributor
  • ***
  • Posts: 1882
  • Country: de
Re: Actual C compiler for Windows for free
« Reply #2 on: October 31, 2021, 10:15:26 am »
Visual Studio Community Edition if you want it for windows -> https://visualstudio.microsoft.com/vs/community/
 

Offline FlyingDutch

  • Regular Contributor
  • *
  • Posts: 144
  • Country: pl
Re: Actual C compiler for Windows for free
« Reply #3 on: October 31, 2021, 10:17:24 am »
hello,

"Visual Studio Comunity" is free software. As one of it's compilers you can install C++ compiler.

Best regards
 

Online PicuinoTopic starter

  • Frequent Contributor
  • **
  • Posts: 714
  • Country: 00
    • Picuino web
Re: Actual C compiler for Windows for free
« Reply #4 on: October 31, 2021, 10:24:57 am »
GCC?
Good for command line. I have an old version of GCC 3.45 from MinGW. What is the newest one? Cygwin perhaps?

Visual Studio Community Edition if you want it for windows -> https://visualstudio.microsoft.com/vs/community/
Good for Windows GUI. Downloading. Thanks
 

Offline daqq

  • Super Contributor
  • ***
  • Posts: 2301
  • Country: sk
    • My site
Re: Actual C compiler for Windows for free
« Reply #5 on: October 31, 2021, 10:48:01 am »
I use CodeBlocks as a whole package - straighforward, no nonsense single download.
Believe it or not, pointy haired people do exist!
+++Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Actual C compiler for Windows for free
« Reply #6 on: October 31, 2021, 11:03:41 am »
 
The following users thanked this post: boB, T3sl4co1l


Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1714
  • Country: se
Re: Actual C compiler for Windows for free
« Reply #8 on: October 31, 2021, 03:45:58 pm »
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  ;).

Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline TheCalligrapher

  • Regular Contributor
  • *
  • Posts: 151
  • Country: us
Re: Actual C compiler for Windows for free
« Reply #9 on: October 31, 2021, 04:01:22 pm »
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 :)
« Last Edit: October 31, 2021, 04:14:58 pm by TheCalligrapher »
 

Offline paf

  • Regular Contributor
  • *
  • Posts: 91
Re: Actual C compiler for Windows for free
« Reply #10 on: October 31, 2021, 04:31:35 pm »
Are you sure you want VLA in C?
https://blog.joren.ga/vla-bad
 

Offline TheCalligrapher

  • Regular Contributor
  • *
  • Posts: 151
  • Country: us
Re: Actual C compiler for Windows for free
« Reply #11 on: October 31, 2021, 04:51:36 pm »
Are you sure you want VLA in C?

Yes, I am. VLA is an extremely valuable feature.

https://blog.joren.ga/vla-bad

The 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
« Last Edit: October 31, 2021, 05:29:09 pm by TheCalligrapher »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14309
  • Country: fr
Re: Actual C compiler for Windows for free
« Reply #12 on: October 31, 2021, 05:06:07 pm »
GCC?
Good for command line. I have an old version of GCC 3.45 from MinGW. What is the newest one? Cygwin perhaps?

All 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/
« Last Edit: October 31, 2021, 05:09:18 pm by SiliconWizard »
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1714
  • Country: se
Re: Actual C compiler for Windows for free
« Reply #13 on: October 31, 2021, 06:17:08 pm »
Are you sure you want VLA in C?
https://blog.joren.ga/vla-bad
Sorry, 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.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1714
  • Country: se
Re: Actual C compiler for Windows for free
« Reply #14 on: October 31, 2021, 06:24:11 pm »
the MS comand line tools, which, BTW, you can also install without Visual Studio IDE.
Technically 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).
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14309
  • Country: fr
Re: Actual C compiler for Windows for free
« Reply #15 on: October 31, 2021, 06:31:45 pm »
the MS comand line tools, which, BTW, you can also install without Visual Studio IDE.
Technically 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.

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

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1714
  • Country: se
Re: Actual C compiler for Windows for free
« Reply #16 on: October 31, 2021, 06:38:45 pm »
Do you mean that the build tools once could be used for free without licensing restrictions before 2017?
As 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 am very careful about these issues).
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4068
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Actual C compiler for Windows for free
« Reply #17 on: October 31, 2021, 07:06:03 pm »
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.
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: Actual C compiler for Windows for free
« Reply #18 on: October 31, 2021, 07:40:36 pm »
.
« Last Edit: August 19, 2022, 04:44:19 pm by emece67 »
 

Offline udok

  • Regular Contributor
  • *
  • Posts: 57
  • Country: at
Re: Actual C compiler for Windows for free
« Reply #19 on: October 31, 2021, 09:11:23 pm »

That said, in that case, I would certainly use GCC and ditch VS tools.

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

Offline TheCalligrapher

  • Regular Contributor
  • *
  • Posts: 151
  • Country: us
Re: Actual C compiler for Windows for free
« Reply #20 on: October 31, 2021, 10:46:17 pm »
That said, in that case, I would certainly use GCC and ditch VS tools.

GCC 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. Nobody develops with GCC, if we ignore statistical noise.
« Last Edit: October 31, 2021, 10:49:21 pm by TheCalligrapher »
 

Offline nigelwright7557

  • Frequent Contributor
  • **
  • Posts: 689
  • Country: gb
    • Electronic controls
Re: Actual C compiler for Windows for free
« Reply #21 on: October 31, 2021, 10:58:40 pm »
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  ;).

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

 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6173
  • Country: fi
    • My home page and email address
Re: Actual C compiler for Windows for free
« Reply #22 on: October 31, 2021, 11:57:51 pm »
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. Nobody develops with GCC, if we ignore statistical noise.
Really?  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.
 
The following users thanked this post: Siwastaja, Karel, newbrain

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14309
  • Country: fr
Re: Actual C compiler for Windows for free
« Reply #23 on: November 01, 2021, 12:35:54 am »
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. Nobody develops with GCC, if we ignore statistical noise.
Really?  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.

Same remarks.
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: 00
Re: Actual C compiler for Windows for free
« Reply #24 on: November 01, 2021, 08:29:41 am »
... without any of the gpl problems Qt brings to the table.

What 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 including
closed 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf