C/C++ compiler with IDE for windows - Page 1
Forum section: electronics / beginners

author: sairfan1
author_rank: Frequent Contributor
timestamp: October 08, 2025, 03:49:27 pm
content: Looking for help on C/C++ compiler that works out of the box on windows environment.I tried installing MSYS64 on my win10, using VS Code i was able to run simple code but if I creare some user header files ie. test.h it does not include and throws error, i spent a couple of days and gaveup. I understand problem is related to CMake to include all user header files but nothing worked. Found that VS Code is a horrible IDE and does not work unless you have specialized extenssion.So I'm looking for some IDE which is fully setup for basic use of C/C++, and on install its ready for use.

author: MarkF
author_rank: Super Contributor
timestamp: October 08, 2025, 03:56:27 pm
content: I too don't like VS Code.You should be able to get Visual Studio (the free community edition).I use an older professional edition. Visual Studio and VS Code are not the same IDE.You create header files from within the Visual Studio or you add existing headers via the IDE.Note, you still need to include them in your c/c++ code.

author: voltsandjolts
author_rank: Unknown
timestamp: October 08, 2025, 03:56:59 pm
content: Visual Studio Pro for $10https://shop.pcworld.com/sales/microsoft-visual-studio-professional-2022-3?utm_source=pcworld.com

author: Siwastaja
author_rank: Super Contributor
timestamp: October 08, 2025, 04:41:28 pm
content: You are mixing things up...Your compiler is most likely perfectly fine. A compiler with faulty #include would be used by no one. Clearly the problem is with the learning curve of cmake. Solution: do not use cmake!Last time I checked (but that is long time ago), mingw was the simplest way to get gcc - which is a compiler - on Windows.Then compiling is nothing more than:gcc.exe your_code_file.cc -o executable.exe -Wall -O2 -I <path_to_any_directory_where_you_want_to_put_header_files_to_be_included>And MS themselves say that VS Code is not an IDE. But don't worry, last thing you want is an IDE if you have problems getting even a simple project compiled. VS Code is OK enough if you want a complex, extendable text editor, but if that seems hard to grasp by all means start with something like Notepad++ or whatever.

author: sairfan1
author_rank: Frequent Contributor
timestamp: October 08, 2025, 05:08:43 pm
content: It did not work, even on Visual StudioCode:// main.c#include <stdio.h>#include "test.h"int main(){show();printf("hello world");return 0;}// test.h on same path#ifndef _TEST_H#define _TEST_Hvoid show(void);#endif// test.c on same path#include <stdio.h>#include "test.h"void show(void){printf("hello from test");}Below is the error message, please note that absolute path to .h file also does not workQuoteLong ago i used a c compiler it handled all CMake related things by itself.

author: kloetpatra
author_rank: Regular Contributor
timestamp: October 08, 2025, 05:28:16 pm
content: Quoteshows it is a linker error, not a compiler error, so there is nothing wrong with the include of test.hyou are missing the compilation of test.cCode:gcc test.c main.c -o executable.exe -Wall -O2 -I.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 08, 2025, 05:32:02 pm
content: You forgot test.c from the command. Trygcc.exe main.c test.c -o executable.exe -Wall -O2 -I.

author: sairfan1
author_rank: Frequent Contributor
timestamp: October 08, 2025, 05:44:09 pm
content: I thought while I'm passing the include files .h i do not need to specify .c files other than main, because main is the entry point.It worked, but in case I have a lot of c files I will keep adding to the command? is there a simple way? like generate some file with build info by command.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 08, 2025, 05:48:20 pm
content: #include just includes the file at that point. It does not instruct compiler to look any other files than that being included.You can of course #include the other .c file as well, but that gets messy very easily, not recommendable.What problem there is adding the files to the command? I mean, you would work potentiallyman-weekson a single .c file (code module). Adding it to the compilation takes a few seconds. To me it seems sensible to have a list of modules somewhere. You can of course just compile *.c but I prefer explicit list.First step to automate it is to write the compile command to build.bat and then run that. I don't suggest even going to makefiles (let alone Cmake) at this point.Separate compiling and linking automated by make starts having speed benefits when your project is a million lines of code.

author: kloetpatra
author_rank: Regular Contributor
timestamp: October 08, 2025, 05:48:42 pm
content: Well, you can write *.c if they are all in the same folder. Other than that, this is exactly what make/cmake is made for.It also should be noted that in this case you do not have to specify any include search path because you included the file with quotes (include "test.h").Using quotes the compiler will automatically search the .h file relative to the path of the currently compiled .c file.https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html

author: sairfan1
author_rank: Frequent Contributor
timestamp: October 08, 2025, 06:38:53 pm
content: Meanwhile by chance reached to these vs code pages, and I followed quite simple steps that made vs code to build and run my c code with CMake.https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/how-to.md#create-a-new-projecthttps://code.visualstudio.com/docs/cpp/cmake-linux#_create-a-cmake-hello-world-project

author: gerbay
author_rank: Regular Contributor
timestamp: October 08, 2025, 06:46:44 pm
content: I recommend Codeblocks (codeblocks.org) for creating a free and high-quality environment.If you download and install the "codeblocks-25.03mingw-setup.exe" file from "https://www.codeblocks.org/downloads/binaries/", you can use it with the compiler without installing anything else.I use the free llvm-mingw compiler. It produces faster-running code. You can add it as a compiler if you like. "https://github.com/mstorsjo/llvm-mingw/releases/tag/20251007"

author: mikerj
author_rank: Super Contributor
timestamp: October 09, 2025, 11:49:12 am
content: I've used Codeblocks for many years, typically for smallish projects such as developing/debugging some more complex functions in firmware projects, command line utilities etc. I see it had a new release in March this year after a very long hiatus, but it's always just worked and is quick and easy to install.

author: Psi
author_rank: Super Contributor
timestamp: October 09, 2025, 12:01:51 pm
content: Is your ultimate goal writing windows GUI/Command line apps or MCU code?

author: u666sa
author_rank: Frequent Contributor
timestamp: October 09, 2025, 12:32:08 pm
content: C++Builder

author: sairfan1
author_rank: Frequent Contributor
timestamp: October 09, 2025, 07:30:15 pm
content: QuoteWindows console app, just to practice C/C++

author: djsb
author_rank: Super Contributor
timestamp: October 09, 2025, 08:25:58 pm
content: Pelleschttps://www.smorgasbordet.com/pellesc/https://forum.pellesc.de/Which also works well with BCX which you might find interesting?https://bcxbasiccoders.com/smf/index.php

author: Psi
author_rank: Super Contributor
timestamp: October 09, 2025, 10:48:02 pm
content: Quote from: u666sa on October 09, 2025, 12:32:08 pmThat's a good idea, C++Builder 12 Community Edition from embarcaderohttps://www.embarcadero.com/products/cbuilder- It works out of the box, no messing with build scrips or files.- Free for non commercial stuff- You can make command line/console apps, or win32/64 apps, even android/mac/Linux apps I think but that is a bit advanced.For command line apps just go File / New / Console application. Save the project.Then you'll get a basic command line app, you just need to add a C++ line to pause for input, it so it doesnt exit instantly when it runs. Then you should be able to hit the compile+run button to make the exe and run it (green button that looks like the play symbol).(Click Run/Parameters from menu if you want to set some command line parameters to your app.)The downside is if you want to switch to selling your app you have to buy it.I don't know exactly how much but probably in the USD$1.5k price range

author: radiolistener
author_rank: Super Contributor
timestamp: October 10, 2025, 03:37:09 am
content: If you want to be tied to Windows and have a solid built-in debugger, go with Visual Studio Pro (not to be confused with VS Code). It’s a full IDE with debugger.However, in most cases you don’t really need a heavy IDE — a good editor with syntax highlighting and autocomplete is often enough.In fact, a lightweight text editor that works in a terminal, such as nano or vim, can even be preferable since it allows you to write and debug code remotely over SSH.

author: Psi
author_rank: Super Contributor
timestamp: October 10, 2025, 05:33:13 am
content: Quote from: radiolistener on October 10, 2025, 03:37:09 amProblem is OP wants it to work out of the box.Install IDE.Type some codeHit compile/run.Any text editor solution needs messing around with makefiles/cmake and calling compiler/linker yourself.

author: IanB
author_rank: Super Contributor
timestamp: October 10, 2025, 05:53:26 am
content: Quote from: sairfan1 on October 08, 2025, 03:49:27 pmVisual Studio Community EditionVisual Studio Community EditionVisual Studio Community Editionhttps://visualstudio.microsoft.com/vs/community/It's free, its full featured, it has huge online support, and it just works.If you are on Windows and you want C/C++, then just get it.There is no good reason to choose anything else.

author: PGPG
author_rank: Frequent Contributor
timestamp: October 10, 2025, 08:49:14 am
content: Quote from: IanB on October 10, 2025, 05:53:26 amI am still using Builder5 (from 2000). I didn't moved to Builder6 because between 5 and 6 they changed their politique and since 6 the simplest version (can't be more precise - don't remember names) you were not allowed for commercial use. As I program C++ typically few weeks a year the simply tool is enough for me.My impression about Visual Studio (I looked at it may be 15 years ago) was that I didn't know how to design my program window (user interface).Can you say few words telling me that I am wrong and in current Visual Studio designing user interface is as simple as in Builder?

author: xvr
author_rank: Frequent Contributor
timestamp: October 10, 2025, 12:20:17 pm
content: QuoteYes and no. VS provides GUI builder for .net applications only. It could be managed C++, but it still .netFor native applications with GUI I use Qt - it could be installed as plugin to VS and it provides GUI designer right inside VS IDE.

author: PGPG
author_rank: Frequent Contributor
timestamp: October 10, 2025, 01:04:07 pm
content: Quote from: xvr on October 10, 2025, 12:20:17 pmThanks. Good to know.I knew about Qt only that 'it is a library with useful functions' and never even tried to use it.I have not learned to use other libraries than I got with Builder (the only .lib file I use is winusb.lib).Didn't know that Qt have GUI designer, and that it can be integrated into VS.Years ago I was reading about C++11, C++14, and C++??, but as I didn't had compiler....The only reason for VS for me would be to play with new things in C++.

author: MrAl
author_rank: Super Contributor
timestamp: October 10, 2025, 01:18:59 pm
content: Quote from: sairfan1 on October 08, 2025, 03:49:27 pmHi,I think Watcom is still around you could try that. Open source code, including the IDE itself.I've used it many times in the past. Haven't done any C/C++ coding in a while now though.Sometimes I think that now Windows programmers are little college kiddies that don't get enough nap time

author: xvr
author_rank: Frequent Contributor
timestamp: October 10, 2025, 01:21:25 pm
content: QuoteVS community edition (2022) supports C++ up to C++23 (and something from next standarts - it calls 'preview - features from latest draft')C++23 also has 'preview' status (C++20 has no 'preview' status there, it is full standart)VS also support using llvm as compiler (out of the box)

author: IanB
author_rank: Super Contributor
timestamp: October 10, 2025, 01:23:50 pm
content: Quote from: PGPG on October 10, 2025, 08:49:14 amIt depends.Visual Studio can create Windows Forms apps, which is probably as simple as Builder, but Windows Forms works with .NET and C#. This is not really a bad thing, as C# is in many ways nicer to use than C++. (Forms is the spiritual successor to Visual Basic GUI building.)If you really want C++ native code, then there is MFC (a set of C++ GUI classes for building desktop apps). But MFC emphasizes power over simplicity, so it would be hard to say it is simple to use.If you want the ultimate in power and control, then you can build WPF apps, but again this is with .NET and C#.

author: voltsandjolts
author_rank: Unknown
timestamp: October 10, 2025, 02:28:30 pm
content: Quote from: PGPG on October 10, 2025, 08:49:14 amHah, I thought I was the only one still using it! I use it for maintaining a 20 year old BCB5 application and it feels snappy, 220MB on disk, starts up in about 900ms. Compiler is old of course, so error messages aren't the best, has some quirks but quite fun really. Meanwhile, MSVS is 3.3GB on disk.I wish there was aLazarusfor C++, it feels a lot like BCB5.