General IDE to learn C++ on - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: December 24, 2021, 11:41:26 am
content: I have "the book" "Programming principles and practice using C++" by Bjarne Stroustrup. It has example and exercises and he recommends visual studio but this was in 2005. Visusual studio or whatever it is called now it rather bloated for running a few lines of code. Anything else worth using?

author: djsb
author_rank: Super Contributor
timestamp: December 24, 2021, 12:14:59 pm
content: I have that book also. Still got to start reading it though. You could try Notepad++I have also tried WxDevC++ and Code Blocks. I started learning C by using LCC-WIN32 and have also tried PellesC as well.Good luck.

author: Simon
author_rank: Unknown
timestamp: December 24, 2021, 12:21:13 pm
content: So does notepad++ handle calling the compiler etc or is it just an advanced text editor.

author: Lindley
author_rank: Regular Contributor
timestamp: December 24, 2021, 12:31:57 pm
content: You cannot get much simpler than the free Arduino IDE .Are you intending to use the Arduino chips/boards or some other micros ?

author: djsb
author_rank: Super Contributor
timestamp: December 24, 2021, 12:37:55 pm
content: Notepad++ is an advanced text editor. It uses a plugin (NCCEXEC) that runs a script. The script invokes G++ (for c++ programs) using the system command terminal. You have to make sure you install the compiler first (explained in another video above)and make sure it can be run from a command prompt. It's all explained in the video I linked to.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 24, 2021, 12:42:24 pm
content: AFAIK Notepad++ is not an IDE.For learning, I think everybody should start with just command line and the simplest possible editor. No automation, no fancy coloring, nothing. This will help a lot with understanding what a nice C++ IDE does under the hood.The steps needed to turn a text source into executable binary are crucial to understand and keep in mind while writing code.Once those steps are well understood, you can switch to something more comfortable than the command line. The IDE I liked most was Visual Studio from Microsoft. There is a free and open source version of it, for any OS. The Linux one is called "VS Code". One of the best IDE out there, can be used with any programming language. I'm a hobbyist in terms of software, but many software devs I've seen doing code for a living were often using Visual Studio.Eclipse is also an IDE I like for its comfort and features, thought many devs are complaining for it being heavy/slower. Anyway, it's good to get familiar with it, because Eclipse+GCC is often used by various chip manufacturers in their proprietary IDEs for MCU and embedded.

author: gamalot
author_rank: Super Contributor
timestamp: December 24, 2021, 12:58:07 pm
content: Visual Studio or Visual Studio Code

author: Simon
author_rank: Unknown
timestamp: December 24, 2021, 05:39:19 pm
content: Quote from: Lindley on December 24, 2021, 12:31:57 pmNo I want to follow the example in the book so embedded environments are out. as for simplest - whatever.

author: Simon
author_rank: Unknown
timestamp: December 24, 2021, 05:40:09 pm
content: Quote from: gamalot on December 24, 2021, 12:58:07 pmNext time read the post!

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 24, 2021, 05:41:25 pm
content: I think this was kind of answered already in a thread asking for a free C or C++ compiler on Windows.If the C++ code you want to work on as an exercise is purely command-line stuff, you can use any free or open-source C++ compiler available on Windows. This other thread mentions them (GCC, CLang...).And if you absolutely insist on using a full-blown "IDE" just to compile small examples, well, to each their own. But I think IDEs were mentioned too. Codeblocks comes to mind, for instance.https://www.codeblocks.org/downloads/

author: gamalot
author_rank: Super Contributor
timestamp: December 24, 2021, 06:42:51 pm
content: Quote from: Simon on December 24, 2021, 05:40:09 pmok, Visual Studio Code

author: bill_c
author_rank: Regular Contributor
timestamp: December 24, 2021, 06:49:56 pm
content: Have you tried Geany?https://www.geany.org/

author: IanB
author_rank: Super Contributor
timestamp: December 24, 2021, 07:12:01 pm
content: Quote from: Simon on December 24, 2021, 05:40:09 pmI will second Visual Studio Code. But Visual Studio Community Edition is perfectly fine to install, especially if you just pick the C++ option when you install it. It really is one of the best options out there.

author: DC1MC
author_rank: Super Contributor
timestamp: December 24, 2021, 07:27:04 pm
content: ++1 for Code::Blocks

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 24, 2021, 07:27:49 pm
content: VS may be fine but the OP explicitely stated that he didn't want it. This didn't look very hard to get.VS community is a HUGE install, even if you selectively disable everything not strictly needed for basic C++ dev (which takes a while and you're not even sure what will be needed or not), because by default it's even more huge. Gigantic.

author: Xupicor
author_rank: Contributor
timestamp: December 24, 2021, 08:51:00 pm
content: Even though you stated your reason for not wanting Visual Studio - it's still the industry standard.VSCode is slimmed down, open source (well, the source is open under MIT license, but the MS branded executables you get from Microsoft are not, seeVSCodiumfor actually MIT-licensed version if you're bothered with that) and multiplatform, I would at the very least keep in mind that there is such a thing, and it's a really good editor/IDE-light. I stress, really good. Also PlatformIO runs on it, if you're planning to get into microcontroller programming in the future.There's Eclipse (CDT) and NetBeans which are available for free, support many languages (Java foremost) and are not bad at all - though being run on Java they (especially Eclipse, in my experience) tend to sag a bit. Might not be an issue for you if you're running a modern PC with an SDD, though, and it wasn't that bad even with HDD, but with bigger projects SDD does alleviate some issues with an occasional lag.If you're just starting you probably won't be running big projects anytime soon. Projects that are one file, or just a couple of files big are perfectly manageable using just a fancy editor like Notepad++, Flo's Notepad2 (I use it as a general replacement for MS Notepad, basically replace notepad.exe with it. It's much snappier than many other programmer's editors mentioned here), Atom, Brackets, Sublime (to name a few newer tech editors), heck, use (G)Vim or Emacs if you're familiar with those, they'll do the job perfectly fine and give you that nineties vibe of linux devs as a bonus.All you need to do is install GCC/MinGW separately, make sure it works in the terminal. You can then just use the terminal to compile your stuff or use solutions built into the editors to do it for you, if they exist.Make sure to learn how to use 'make'. It'll come in handy.Not a fan of Code::Blocks, but it does indeed come bundled with GCC/MinGW (how old of a version though, I don't know) and it is an IDE, not just an editor, so it's also an option.I'd stay away from Dev C++ IDE, even though it has been quite popular due to some youtube tutorials (and even some books, regrettably... though not all of them bad at all!) being based around it.Advice:Either in the terminal when compiling by hand, makefile, or project options/compiler options in your editor/IDE, be sure to add something akin to this in your compilation line:-pedantic -Wall -Wextra -std=XXXXwhere XXXX is a standard revision, like so:-std=c++20. Forcing compliance with other (older) versions of the standard is possible as well. More info in theGCC manual.This will enable a lot of useful warnings and disable some GCC specific extensions that you probably have no interest in using at the moment anyway (as they aren't strictly a part of the language). Those errors and warnings will keep you safe(r) and will help to guide your way. Use them to your benefit. Disable them at your own peril.Maybe add-Wfatal-errorsin there to stop compilation after the first error so that you don't have to wade through many lines of error messages which very well might disappear after the cause of the first error is taken care of. (Always start solving problems with the first error reported.)Opinion:I agree to an extent that it's good to start with barebones setup and then go on to see what goodies more advanced editors/IDEs bring, but I would say an editor WITH syntax highlighting is the minimum. There's really no need to torture yourself without this very useful feature. I mean maybe for an hour or so to see what people in the middle ages had to go through, but let's be civilized over here.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: December 24, 2021, 10:50:26 pm
content: Nothing wrong with Visual Studio for C++.I wrote a 500,000 line C++ program using it.You can output stuff to message boxes so you can see the results of your code.The community edition is free too.

author: Simon
author_rank: Unknown
timestamp: December 25, 2021, 08:10:16 am
content: Eventually I'll be doing C++ on embedded. But for the purposes of the book I need to go through the exercises on a PC. Visual studio "whatever" is just the now common microsoft pain in the butt! It wants a windows log in or something that at work won't work, it will want to constantly update, I have several gazillion types of projects I can start - yes my fault for getting ahead of myself - and even when I follow the instructions in the book carefully I get a big fat nothing plus issues that are IDE related. I want to learn to code, not how to drive microsoft's latest mess only for it all to change next week.Maybe command line compiling is the best option for this sort of thing.i have downloaded codeblocks. Was trying to remember if it's the mess that MPLABX is based on that is the only program on earth that is obstinate about being made to work on a 4k monitor rather than just doing as it's told like all other programs. But no that is notbeans.

author: Gixy
author_rank: Regular Contributor
timestamp: December 25, 2021, 08:17:51 am
content: VS Code + PlatformIO, nothing more, nothing less. Much more simple than Eclipse.

author: IanB
author_rank: Super Contributor
timestamp: December 25, 2021, 08:26:05 am
content: Quote from: Simon on December 25, 2021, 08:10:16 amFor small code snippets, you might want to look at one of the web compilers. There are various lists of these to give you an idea of what to look at, for example these ones:https://www.techgeekbuzz.com/best-online-cpp-compiler/https://arnemertz.github.io/online-compilers/Compiler Explorer (Godbolt) is a good example, and is fun to use:https://godbolt.org/

author: djsb
author_rank: Super Contributor
timestamp: December 25, 2021, 08:46:57 am
content: I have just compiled the "hello_world.cpp" example in Chapter 2 of the book using Code:blocks.I started a new project of type "console application" in the "new from template" dialog and then completed all the entries in the wizard. Make sure you download the std_lib_facilities.hheader file by typing stroustrup com programming std_lib_facilities h in google. Then replace the header file in the main.cpp file of your project with #include "std_lib_facilities.h". You also have to add "std_lib_facilities.h" to your project by right-clicking on the "hello_world" project in the tree to your left and choosing "add files" and then pointing to where this header file is located.You then click on the green arrow/cog icon (Build and run), and it should compile properly and produce a command window with the "hello world" message and then asks you to press any key to continue.

author: RoGeorge
author_rank: Super Contributor
timestamp: December 25, 2021, 09:32:02 am
content: https://www.eclipse.org/downloads/packages/Download, unzip, and run. No need to install. There is another page if you want Eclipse with installer. Another way is to configure your own Eclipse, but that might be tricky for a first time. However, there are 2 "Eclipse" pre-configured for C/C++, one is for PC dev, the other for embedded dev, you can get them both:https://www.eclipse.org/downloads/packages/release/2021-12/r/eclipse-ide-cc-developershttps://www.eclipse.org/downloads/packages/release/2021-12/r/eclipse-ide-embedded-cc-developers

author: DC1MC
author_rank: Super Contributor
timestamp: December 25, 2021, 10:03:52 am
content: Regarding Code::Blocks, I leave this here, as is not so wide known:Like many other IDEs, it has it's own project definition file (readable XML, not some (semi)binary rubbish), some times it is necessary to give your project in buildable source and a Makefile will help with the "purists" that do not conceive anything else than Makefiles.So we havehttps://github.com/mirai-computing/cbp2makethat converts the project to a pretty easy to understand Makefile, if a bit too verbose and explicit for the purists that come with the dreadful one-liners for the leet, that are uses to job security and showin off.Cheers,DC1MC

author: Simon
author_rank: Unknown
timestamp: December 25, 2021, 10:09:38 am
content: Quote from: DC1MC on December 25, 2021, 10:03:52 amThat made no sense to me at all. To restate for those running away with themselves:1) i have a book2) it has exercises that need to be compiled and run on a console3) the IDE recomended does not really exist anymore4) I need an IDE that will not do silly stuff like the book itself warns of VS of 2005 running the code you just wrote and then closing the console window so that you can't see the result and think you did it wrong despite it being fine.5) I just need something that works without hours of learning it and how to make it not do it's own thing it thinks is what I want because ultimately I need to run on embedded so getting into the whole how this will compile a program for windowsn is not very relevant right now.

author: djsb
author_rank: Super Contributor
timestamp: December 25, 2021, 10:14:52 am
content: Did you read my post above?

author: DC1MC
author_rank: Super Contributor
timestamp: December 25, 2021, 10:23:59 am
content: Quote from: Simon on December 25, 2021, 10:09:38 amSimon, C::B does this by the default install, no need for other plugins or utilities except what is included in the default install, as some other forum member showed practically how to compile the "Hello world" example with C::B on the Windows platform, on Linux is even simpler. So just install it an run it, it takes maybe three minutes to test your examples.The Makefile generator utility I've mentioned here in case you'll proceed further after the book and maybe share your project or give it to a customer.I'm willing to drive you trough the hops with C::B and a couple of your book examples via Skype, Zoom, Jisti, whatever, as the weather here in the German industrial town is completely shite (pouring rain, 12C, wtf, is end of December) and I'm blocked in front of the PC anyway.Cheers,DC1MC

author: paf
author_rank: Regular Contributor
timestamp: December 25, 2021, 11:45:02 am
content: Supposing you usually have a Windows PC, you have several alternatives:1) Install WSL2 and Debian or Ubuntu on WSL2 and VS Code or other editor on Windows. You can edit the files from Windows and run them on the WSL terminal.2) Install Virtual Box, a Linux on Virtual Box, and define a shared folder. You can edit the files from Windows and run them on Linux.3) Install Virtual Box, a Linux on Virtual Box, and define a shared folder for file sharing. You can edit the files on Linux using an editor/IDE like Geany.4) Install Linux on a PC. You can edit the files on Linux using an editor/IDE like Geany, or any other simple editor.On Linux/WSL besides using the latest version of gcc or llvm for compiling, when you don't understand what the hell is happening with your C/C++program, you can:a) Use all the complier warningsb) Use cppckeckhttps://cppcheck.sourceforge.ioc) Use splinthttps://splint.org/(Only C)d) Run your program with Valgrindhttps://valgrind.orge) Debug your program with gdb (which has support for many embedded micros).All these suggestions are also valid for embedded development.

author: hgl
author_rank: Regular Contributor
timestamp: December 25, 2021, 11:58:09 am
content: QuoteEvery C / C ++ program begins with calling "main" and ends with exiting main. If you do not want your console to close, simply add a keyboard query to the end of your code and wait for a key to be pressed.QuoteIf you want to write embedded code you need a cross-compiler for your target system. Visual C can't do that. Usually GCC is used for this. There is no console in embedded systems without an operating system. Your code runs in an endless loop within main.An online IDE can be used for the book examples.https://ide.judge0.com/For embedded code, I would recommend Visual Studio Code with GCC. VSCodium is the same without Mirosoft extensions.Is faster and easier to use than Eclipse.

author: DC1MC
author_rank: Super Contributor
timestamp: December 25, 2021, 12:11:42 pm
content: Quote from: paf on December 25, 2021, 11:45:02 amBecause all of this complex stuff is so much easier for a beginner than downloading the Code::Blocks installation package with included gcc compilers for Windows:https://www.fosshub.com/Code-Blocks.html?dwl=codeblocks-20.03mingw-setup.exethen after finishing his book examples go in Linux and get the same package plus whatever cross compilers and just retarget his project with a couple of clicks

author: JohanH
author_rank: Frequent Contributor
timestamp: December 25, 2021, 12:22:23 pm
content: If you want to learn embedded, learn to use linux command line and gcc. When you understand the basics, you can move to any platform and whatever bloated environment you want.

author: djsb
author_rank: Super Contributor
timestamp: December 25, 2021, 12:31:06 pm
content: As a beginning programmer all I want to do is to get through the book and actually learn the language, NOT fight the IDE. This is why setting up the development environment is a big hurdle to get over.Notpad++ and code:blocks works for me and I have the exact same book as Simon has. I've been put off actually reading the book until now as I have come across the same problems with bloated and intimidating IDE software.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 25, 2021, 12:31:48 pm
content: Quote from: Simon on December 25, 2021, 10:09:38 amSo you don't need an IDE. All you need is compiler and any text editor of your choice. I use gedit, used to use Notepad++ and Programmer's Notepad far in the past in my Windows days. Many have some helpful programming features like syntax highlighting without all the bloat. Minimize number of tools by not using unnecessary tools. Compiler itself can't be avoided.You can configure many text editors to run a command on a keypress but I don't bother, with today's multitasking operating systems, why not just have multiple windows open, code editor in one window, command prompt in another.Either write a makefile or if that sounds too compilated (I accept it is), just m.bat or m.sh, then just run m on the command prompt window and it compiles.Compiling on g++ for exampleg++ -Wall excercise.cc -o excercise[.exe]You can even just write this and press the arrow up key and enter to compile.Doesn't need to be made difficult.With todays large display resolutions (1920 pixels minimum, and sometimes more! wow!), you can easily run the command prompt and the code editor side-by-side so that alt+tabbing doesn't mess up your visual concentration. Compared to this, some IDEs, at least by default, give a tiny output on the bottom of the screen which fits maybe 10 lines.

author: DC1MC
author_rank: Super Contributor
timestamp: December 25, 2021, 12:37:20 pm
content: Quote from: jukk on December 25, 2021, 12:22:23 pmSure, after spending like 30min - 1h learning vi, then spend another hour or such to learn the advanced syntax for Makefiles and its interaction with gcc, also spend 2-3 hours to understood all the advanced gcc switches related to specific architectures, make sure to focus on your installed gcc version as they may produce different effects on each version, then CMake and Ninja meta-generators are a big help and makes your life easier, so spending another hour or two understanding them may help with complex projects, otherwise vi (vim if you want to go on the bloated way) and gdb should be enough for an absolute beginner. All in all a Saturday*well spend for your future professional development.* = It has to be noted that the hours mentioned above are Saturnian hours and a Saturnian Saturday as well, if done less frequently it may take a Saturnian month.This is how all the experts on the forum learned this stuff, and they've now won by hard work and dedication the right to summarily dismiss all of those "bloated IDE" that do all this stuff with a couple of clicks.NOTE: Code::Blocks is NOT bloated, is one of the most lightweight IDE for the feature it offers.

author: Ian.M
author_rank: Super Contributor
timestamp: December 25, 2021, 12:54:17 pm
content: The Orwell fork of Bloodshed DevC++ still works, and is a lot lighter than many other IDEs that have been suggested.https://sourceforge.net/projects/orwelldevcpp/However it is a bit fussy to set up to use a recent GCC compiler properly. Grab TDM-GCC 10.3.0 from:https://jmeubank.github.io/tdm-gcc/and install it. You probably want (and only need) the 64 bit install unless you are using a legacy 32 bit Windows. Make sure you add the MinGW tools folder to your user (or system)path(on my system that'sC:\TDM-GCC-64\x86_64-w64-mingw32\bin), otherwise Dev C++ cant do a 'Clean' or 'Rebuild All' successfully (the default makefile needs rm.exe to be findable on the path).Next you need to set up the new TDM-GCC 10.3.0 compiler. in Dev C++. Launch Dev C++ and without opening a project, open the menu 'Tools': 'Compiler Options'. Use the 'Add a compiler set by folder' button (middle of the five grouped buttons - green +) and give it your TDM-GCC root folder (on my system that'sC:\TDM-GCC-64). Rename the new compiler fromTDM-GCC 10.3.0toTDM-GCC 10.3.0 64-bit Release(assuming your on Win x64). Now add another instance of the same compiler, but this time rename it toTDM-GCC 10.3.0 64-bit Debugand in the tab 'Settings': 'Code Generation', set the 'Optimization level (-Ox)' to 'Debug (g)', in the tab 'Settings': 'Linker', set 'Generate debugging information (-g3)' to 'Yes', and check that 'Strip executable (-s)' is set to 'No'.For convenience, you may wish to add some utilities to the Dev C++ tools menu (by 'Tools': 'Configure tools...').I have:'Explore Project Files' which invokesexplorer.exewith parameters<PROJECTPATH>'Console (in project folder)' which invokesC:\Windows\System32\cmd.exewith working directory<PROJECTPATH>You should now be able to follow any reputable Dev C++ tutorial, or book using Dev C++ with no IDE or toolchain issues.

author: m k
author_rank: Super Contributor
timestamp: December 25, 2021, 02:49:59 pm
content: Quote from: Siwastaja on December 25, 2021, 12:31:48 pm+1I'm usually reading manuals in Adobe Reader same way, just make enough copies.I've used Borland stuff for quite some time.Can't open a window with MFC.Community stuff seems to be timed these days.May, after all, be a better way

author: TheCalligrapher
author_rank: Regular Contributor
timestamp: December 25, 2021, 05:08:55 pm
content: Quote from: paf on December 25, 2021, 11:45:02 amIf you are using GCC for learning, the first and foremost thing you can do (in both C and C++) is specify `-pedantic-errors` so that the compiler reports errors aserrors. A experienced programmer can usually tell, which of GCC "warnings" is not really a warning but a hard error. A student usually can't. This is where `-pedantic-errors` comes to the rescue.This is, of course, if you want to learn the actual language, instead of the motley/pidgin dialect implemented by GCC in its default configuration.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: December 25, 2021, 05:29:51 pm
content: Quick question.Does anybody use Kdevelop anymore?

author: IanB
author_rank: Super Contributor
timestamp: December 25, 2021, 05:59:37 pm
content: Quote from: Simon on December 25, 2021, 10:09:38 amDid you read my post about online web consoles like godbolt.org? It will do fine for small book examples. It's what experienced programmers use to test things all the time.

author: DC1MC
author_rank: Super Contributor
timestamp: December 25, 2021, 06:23:52 pm
content: Quote from: Ed.Kloonk on December 25, 2021, 05:29:51 pmI think that, except for some QT development, it went into the way of Anjuta.

author: paf
author_rank: Regular Contributor
timestamp: December 26, 2021, 11:53:05 am
content: Installing Linux (using WSL2) is easy and fast. When using Linux, if you have a shared folder with WSL2 or Virtual Box, you can use any Windows editor you want/like to edit the source files, and user the Linux command line to compile and run the programs.Even when using Linux you are not forced to use vi(m) or emacs to edit the source code. Other beginner friendly "terminal" editors available are nano, pico, joe, micro, ash and jed.In graphical mode you have Notepad++, Geany, Kate, Atom, Sublime Text or Visual Studio Code.Another fast and easy way (but somewhat limited) way of having a Linux command line machine that allows compiling C++ code is grabbing an Android device and installing Termux on it:https://termux.comAnother suggestion about embedded C++ is going to YouTube, search for "Dan Saks" and watch his videos.

author: Simon
author_rank: Unknown
timestamp: December 26, 2021, 02:46:20 pm
content: Quote from: IanB on December 25, 2021, 05:59:37 pmYes, that is also a way of doing it.

author: DrG
author_rank: Super Contributor
timestamp: December 26, 2021, 03:43:19 pm
content: I don't know C++ either and, on occasion, consider learning/doing more in that arena. When I have dabbled, I use some form of VS. I have the newer 'community' version as well as some 2012 or so (too lazy to look). The position that they are bloated and a pain is justifiable.So, I thought about your general example, "I got this book and they say to use____". In this case I was looking athttps://www.amazon.com/Hours-Sams-Teach-Yourself-6th/dp/0672337460to see what they recommended and they said:MinGW-w64https://sourceforge.net/projects/mingw-w64/Which looks interesting and I don't think it has been mentioned in this thread.https://www.mingw-w64.org/They also mentioned VS varieties which has already been discussed.

author: djsb
author_rank: Super Contributor
timestamp: December 26, 2021, 04:05:57 pm
content: You can download Code:Blocks with the MinGW compiler included (which means it is installed alongside C:B) or opt to download C:B without the compiler if you already have one installed or want to install it separately.https://www.codeblocks.org/downloads/binaries/

author: ejeffrey
author_rank: Super Contributor
timestamp: December 28, 2021, 03:12:37 am
content: You are simply not going to find anything reasonably called an IDE that isn't "bloated"You can use your favorite advanced text editor plus manage your own tool installation, setup and build system or you can get a bloated IDE. Those are your options.Mostly the only games in town for IDEs are visual studio, eclipse, and jetbrains each of which come in several variants. They are all huge but they will all do what you need (and much more)Or you could install Linux or WSL and use g++ from the terminal. That's a good thing to learn anyway.

author: Simon
author_rank: Unknown
timestamp: December 28, 2021, 01:16:14 pm
content: My point was that the book recommended visual studio based on what it was in 2005, I am fairly sure that it is a bit different now in 2021. I never did get the exercise to work.

author: nctnico
author_rank: Super Contributor
timestamp: December 28, 2021, 01:55:47 pm
content: Quote from: Simon on December 24, 2021, 11:41:26 amNo. If you want to get serious about programming in C/C++ you will want to learn how to use a proper IDE. Eclipse CDT comes with a lot of useful features out of the box (like realtime syntax checking, outlines, function cross references, etc, etc). Visual Studio Code is also a good option but you will have to add a whole bunch of plugins to get it to the comfort level of Eclipse CDT.Going the text-editor / command line route will only lead to more frustration. Going through pages of warnings trying to find the error message that prevents your program from compiling. OR missing that important warning about a bad type conversion.If you want to venture further down the software development path: I can highly recommend to learn how to use Git. It makes life a lot easier because it allows to you to go back to previous versions (if you cared to commit them) and thus making experimenting with bits of code much easier.

author: Simon
author_rank: Unknown
timestamp: December 28, 2021, 02:06:48 pm
content: At the moment I just need to follow the exercises in the book. My first use will be in microchip studio for embedded stuff. Anything else will come later.

author: nctnico
author_rank: Super Contributor
timestamp: December 28, 2021, 05:23:25 pm
content: But how are you going to test your code? Step through it line by line with a debugger for example to see what is happening with the variable values. That is much easier to do on a PC based IDE than on a microcontroller. Likely Eclipse CDT and Visual Studio code offer a way easier to use workflow compare to Microchip's own IDE. Last time I had to program for a PIC processor I used Eclipse CDT instead of Microchip's own environment.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: December 28, 2021, 05:32:09 pm
content: Quote from: nctnico on December 28, 2021, 05:23:25 pmAs an aside, this youtuber shows how to do it with VS.

author: rstofer
author_rank: Super Contributor
timestamp: December 28, 2021, 05:58:38 pm
content: Quote from: RoGeorge on December 24, 2021, 12:42:24 pmExcept... It won't print your files! To me, this seems like a really HUGE failing. Nevertheless, I use it for Python and VHDL and when I want a listing, I use Notepad++.I would just get used to Visual Studio Community Edition (free) on Windows. For Linux, I would probably just use GCC from the command line. I run gfortran from Eclipse so I'm into most of the high end IDEs.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 28, 2021, 07:04:04 pm
content: Quote from: rstofer on December 28, 2021, 05:58:38 pmThere are tons of options on Windows as well, as we mentioned. You can use command-line GCC or Clang either on MSYS2, or even directly in a Windows console. You can also use Codeblocks, which integrates all this nicely, so easier for people not comfortable with the command line. Or another IDE of your liking, and set it up for your compiler. If you like Notepad++, so be it. There is Geany also, which is rather nice, and has printing (and is cross-platform, while not being Java!). There's also Vim, for those who are into that, or Emacs, or Atom, or a bunch of others..There definitely are a lot of options beyond MS tools. Some people here make it sound like there isn't, and frankly some even almost sound like MS salespersons.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 28, 2021, 07:30:49 pm
content: Quote from: Simon on December 28, 2021, 01:16:14 pmAnd everyone here is telling you it's still a good recommendation in 2021. There are other options as well. Just pick something and use it. Literally anything you pick will work for your needs. Don't worry about "bloat." You will have to learn how the tool works but you should be able to get any tool you pick running in an afternoon.

author: Ian.M
author_rank: Super Contributor
timestamp: December 28, 2021, 08:08:28 pm
content: Quote from: Simon on December 28, 2021, 01:16:14 pmQuote from: Simon on December 28, 2021, 02:06:48 pmAs I said earlier, Dev-C++ is still usable under Win 10, and can be upgraded to a reasonably current GCC version. It took me about five minutes to create a Win32 Console project and enter the "hello_world.cpp" example from chapter two of your book, and as soon as I realized that the header "std_lib_facilities.h" is custom for the book and needs to bedownloaded from Stroustrup's site, I added it to the project, and it then compiled with no errors or warnings and ran successfully and correctly.I detailed what's needed to get Dev-C++ up and running under Win 10 back inreply #34and attach the minimum set of project files for Dev-C++ for the chapter two hello world program. Just unzip them in a new folder, open the '.dev' (project) file and build and run.

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 28, 2021, 08:27:56 pm
content: Ah yes, I forgot about Dev-C++ (I thought it was dead, actually, but apparently, Embarcadero now "hosts" the project. But it's open-source and available there:https://github.com/Embarcadero/Dev-Cpp)So, that's indeed yet another option.

author: IanB
author_rank: Super Contributor
timestamp: December 28, 2021, 09:51:04 pm
content: Also, see this page:https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170QuoteSo, if you are really opposed to using an IDE, you can download and use the Microsoft compilers without needing to install Visual Studio.Honestly, I do understand the annoyance of making a new project in an IDE just to run a few lines of code. The way I approach this is to make a "learning project", and then for each small example I want to test I just make a function in my project containing those few lines of code. It's pretty easy to have the main program call whichever test function I want to run.

author: Simon
author_rank: Unknown
timestamp: December 28, 2021, 10:52:20 pm
content: Quote from: nctnico on December 28, 2021, 05:23:25 pmFFS read!Lets start again for the hard of hearing (and intellect!):while my ultimate aim is to program on a micro-controller I am following (or will when I get the time to set this up) a book with examples to use on a PC. The book recommends VS but does point out that this is 2005 (the guy had vision and knew that the book would be read years later when the IDE would be totally different and a mess). So if I try to follow the setup described notthing happens. So clearly as the author anticipated the IDE in 2005 has now changed to the point that it's more work to get the IDE to work than do the example.Therefore I am looking for an IDE that is as simple to use as VS was in 2005 to carry out the examples as intended on a PC!Once I have got to grips with the language yes my target will be embedded, for now I want a hassle free IDE that lets me test the code as I need at least one first little test program to work before I can figure if it's me or the IDE.

author: Simon
author_rank: Unknown
timestamp: December 28, 2021, 10:55:48 pm
content: Quote from: ejeffrey on December 28, 2021, 07:30:49 pmNO IT WON'T AS IT HAS NOT!. Clearly VS in 2021 is more complex than in 2005, I tried it and nothing happened! clearly too much going on, I need something that won't try to be too clever and just do what ID need it to, ever heard of MS writing software like that in the last decade? no me neither! I also want to use it at work and if I have to update something or log back in every 5 seconds I will drive the IT contractor up the flaming wall!

author: IanB
author_rank: Super Contributor
timestamp: December 28, 2021, 11:28:53 pm
content: Simon, you seem to be getting very agitated, but it is hard to figure out where the difficulty lies among three things:1) Installing (just) the C++ desktop workload for Visual Studio Community2) Getting code samples from the book to run3) Following instructions in the book for installing Visual StudioFrom your comments, it seems like you might be getting stuck on (3), but if so, do not even think about following those instructions. They will be 15 years out of date, and no longer applicable.For item (1), if you were to go this way, you would just pick the "Desktop Development with C++" workload (see screenshot below), andnothing else. I am probably going to do this on my computer in a minute just to verify.For item (2), this should be quite straightforward, once you have a compiler installed.However, there is a caveat that nobody has mentioned in this thread so far. The C++ language today has evolved far beyond where it was in 2005. In 2005 we had "traditional C++" as Bjarne Stroustrup originally conceived it. Today, we have "modern C++", which has a much better, safer, and more reliable way of programming (which Bjarne Stroustrup strongly recommends).So if you are going to learn C++, it would be best to use a modern reference, and try to use language standard C++17 or later.The only counter to this, is for embedded programming, where vendor toolchains may not support all the features.However: learning how to program includes learning how to obtain, install, and use development tools. You need to consider this as part of your learning exercise, and not just focus on the code examples.

author: IanB
author_rank: Super Contributor
timestamp: December 28, 2021, 11:38:31 pm
content: Here it goes:

author: IanB
author_rank: Super Contributor
timestamp: December 28, 2021, 11:50:03 pm
content: And it's done, installed and working:

author: Tony_G
author_rank: Super Contributor
timestamp: December 29, 2021, 12:25:30 am
content: I think that Ian's post is pretty good start on the process of installing.That said, Simon, I worked on the VS team for 17 years, and seeing how you're frustrated at using VS and the work you do for the forum as a moderator, I'd be more than happy to spend some time in a Zoom meeting with you to get you going in VS2021 Community Edition.Just PM me if you'd like to give this a try.TonyG

author: DrG
author_rank: Super Contributor
timestamp: December 29, 2021, 03:53:02 am
content: I was looking at the book today. There are some other potential concerns with using a modern compiler/linker/IDE/OS with some of those code examples and exercises.As was mentioned earlier, there is a common header file that needs to be usedwww.stroustrup.com/Programming/std_lib_facilities.hand that certainly is available, but could cause some issues. Maybe not though as you can see this comment "Revised August 3, 2020: a cleanup removing support for ancient compilers".The graphics/GUI exercises and code use a tool library FLTKhttps://www.fltk.org/In the book, they use "FLTK 1.1.x" and I see you can still download 1.1.10, but I wonder if VSC22 will barf at the thought. More importantly, I wonder if modernish Windows will barf. Anybody have some thoughts on that?I don't know, but I do know who the author is and I understand why you would want to start to learn C++ from him, but there are more modern texts available - no?

author: Siwastaja
author_rank: Super Contributor
timestamp: December 29, 2021, 11:57:21 am
content: I can feel the frustration.Do this:Install mingwWrite hello world example.Compile by:g++ test.cc -o test.exeRun:test.exeTake small steps. Go from there.And despite what nctnico says, you don't absolutely need a full-fledged IDE. You might want it, you might not, it's also a personality question. I have no issue whatsoever working with a text editor and command line, but I do many other things completely opposite how nctnico claims they "must" be done, as well. I don't get frustrated at large number of errors and warnings because I don't usually write massive pieces of untested code at once. When I do, then I just work through the errors and warnings one by one, but this doesn't happen often.But yeah, C++ has a tendency of generating 100 screenfuls of cryptic error messages on a slightest typo. I kinda understand the appeal to helper tools with such horrible language. You can still start without. I actually started with C++ as my first programming language - it was very new and trendy back then - and definitely did not have any IDE; not even alt+tab because was in MS-DOS, so it was save - exit - compile - start editor again process. That sucked, yes, but got the job done anyway.

author: Simon
author_rank: Unknown
timestamp: December 29, 2021, 12:02:04 pm
content: The book is relatively recent but was first written a while ago so some of the text is old. This is why I suspect he noted the 2005 against the recommendation for VS. As there is now more to VS than then trying to follow setting up the IDE is not possible. I thought I had picked a console project and I don't think the option to keep the console open was there so it made the whole thing futile. My code may have run perfectly but I just never got to see it.This is why I was thinking something a little simpler.

author: Simon
author_rank: Unknown
timestamp: December 29, 2021, 12:04:44 pm
content: Quote from: Siwastaja on December 29, 2021, 11:57:21 amI do like to use colour as a way of differentiating things. I find reading block capitals hard so I prefer the colour coding of defines rather than writing them in block capitals

author: emece67
author_rank: Frequent Contributor
timestamp: December 29, 2021, 01:52:37 pm
content: .

author: DrG
author_rank: Super Contributor
timestamp: December 29, 2021, 02:29:08 pm
content: Quote from: Simon on December 29, 2021, 12:02:04 pmThat is normal Windows console window programming working.If debug mode, I make sure this is unchecked (VS19) [Tools->Options->Debugging->Automatically close the console]But, this situation is well known and VS has advanced beyond having to use getchar() in the code to make blocking loops to keep the window open.See herehttps://stackoverflow.com/questions/1775865/preventing-console-window-from-closing-on-visual-studio-c-c-console-applicatio[and a bunch of other places]

author: Siwastaja
author_rank: Super Contributor
timestamp: December 29, 2021, 02:59:27 pm
content: Quote from: Simon on December 29, 2021, 12:04:44 pmI also do use a text editor (gedit) which comes with decent syntax highligting. It's advanced enough to understand that #if 0 #endif is a comment, and color the text accordingly.Between a massive bloat IDE and vi, there are many options.In Windows, I'm pretty sure Notepad++ hits the sweet spot of being more than just primitive text editor, without being a full fledged IDE. But it's over a decade I last used it.

author: nctnico
author_rank: Super Contributor
timestamp: December 29, 2021, 03:34:44 pm
content: Quote from: Simon on December 28, 2021, 10:52:20 pmDon't try to run before you can walk. Also don't expect a book from 15 years ago to be accurate. The C++ standard has changed in the meantime as well so some examples in the book could use constructs that throw an error instead of a warning.To get going with Visual Studio Code:https://code.visualstudio.com/docs/setup/windowshttps://code.visualstudio.com/docs/cpp/introvideos-cppFound these with a website called Google.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 29, 2021, 03:43:08 pm
content: Yeah, C++ has really indeed changed.I learnt it in mid-90's. Then I learned it more in university in mid-2000's and had to use it at work around 2010. It felt like completely different language than what I originally learnt. Now if you look at the 2021 state, it'sagaincompletely different language.It has changed both for worse, and better. Worse in the way that it's even more complex because not much is removed, only added to it. If you want to interact with other programmers, you need to understand a lot of different constructs. But better in the way that the new features can help reduce amount of boilerplate and make the language higher level.In any case, C++ will be a massive beast for a beginner, and you can't go for arbitrarily minimal subset if you want to "know C++". For personal and practical purposes, you can of course limit to a tiny subset.Sorry but if your biggest hurdle is that the IDE automatically closes the terminal window unless you check a checkbox in configuration, and this is enough to make you feel like giving up, I'm not sure if C++ is a good language for you. You need the endurance, because struggling is inevitable.Some really modern examples, written to be as simple and as high level as possible, could be helpful. It's never a good idea to rely on a single book.

author: DrG
author_rank: Super Contributor
timestamp: December 29, 2021, 04:36:13 pm
content: So, I want to present a different perspective or, at least, a different context with respect to:QuotePlease understand, that I harbor no hard feelings toward you (@Siwastaja) and, to the degree that I can remember, your reputation here is fine.Nevertheless, what you say there is a bit on the “putting on airs” side. When someone starts on a road, you really do not know where they will end up and it could be in a place that is much “higher” than the place you are at – you just don’t know – even when you know, you don’t know (see reference to the movie “Let it Ride”).I entered this thread because I am at a place with C++ not unlike the OP’s place. I don’t know C++. While I have “used” it sparingly, I don’t feel like I really know it at all, but learning it is on a very long “to-do” list. My last encounter with learning it shows herehttps://www.eevblog.com/forum/programming/scaling-brightness-using-pwm/msg3542942/#msg3542942Translating some messy Arduino code/crap to a little better organized and systematic program was a good candidate for a little C++ learning.I had the SAME issue and that was in March of this year.WTF?!! How am I going to rewrite the code when the &^@#$%ing window closes on me?! FFS, I am going backwards, not forwards, and I do have other things to do, so FTS!Which person in this thread has not had similar ideations at some time?So, yeah, I worked through that, but not because I went through 751,861 options in VS2019, but because I searched until I found some solutions (IOW I asked a friend, or rather eavesdropped on a conversation where someone asked a "friend" – i.e., the internet through Google.Look at this passage in the very book in question (appendix C):QuoteOK, maybe he was wrong in the sense that there ARE a few options you need to worry about straightaway, but the OP did ask experienced "friends" and there were plenty of responses, so that is a good thing.

author: nctnico
author_rank: Super Contributor
timestamp: December 29, 2021, 04:55:49 pm
content: Quote from: DrG on December 29, 2021, 04:36:13 pmMe certainly. But approaching a problem by throwing tantrums is not going to solve anything. In my experience it is better to take a break (go out for a walk or cycling) and give your brain a rest so it can process & organise the problem.Nowadays it is super easy to find information on internet on how to achieve something. A couple of years ago I changed to a different PCB layout package. I didn't took a course because I had to get the program going before the first course dates so I used online tutorials and fora to get me going. A couple of hundred hours in I'm pretty good at using the package but I'm still learning. Yesterday I wanted to add some dimensions to a board layout for example. Google found me a video which showed me exactly how to do that.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: December 29, 2021, 05:03:37 pm
content: You should let us help you with the issue of how to get a modern VS running your code as opposed to finding something akin to VS2005. IDEs are much much better now.If you decide to hate VS my opinion is you have two choices: CLion and NeoVim.Good luck!

author: PlainName
author_rank: Super Contributor
timestamp: December 29, 2021, 05:25:37 pm
content: Quote from: IanB on December 28, 2021, 11:38:31 pmBlimey!

author: IanB
author_rank: Super Contributor
timestamp: December 29, 2021, 05:47:42 pm
content: Quote from: Simon on December 29, 2021, 12:02:04 pmAh, yes, this "feature" has been present in all versions of Visual Studio from the beginning, including the 2005 version. If you do a lot of debugging it does kind of make sense though.The simplest solution is to use the "Start Without Debugging" option (the button highlighted in the screenshot below). At least this is on the toolbar by default in the latest version of VS -- in earlier versions you had to customize the toolbar to add it, or find it on the Debug menu. You can also use the keyboard shortcut, Ctrl-F5.Part of learning to program is learning to use the tools, so you should expect to invest some time into this. It's not much different from learning to use an Oscilloscope when doing electronics.

author: Ian.M
author_rank: Super Contributor
timestamp: December 29, 2021, 05:56:09 pm
content: Orwell Dev-C++ installer 50,433,966 bytes (48 MB)TDM-GCC 10.3.0 full installer 80,474,875 bytes (76.7 M)Total130,908,841 bytes (124.8 MB)or you could go with the even smaller download of the Embarcadero DEV-C++ fork which includes TDM-GCC 9.2.0, if you trust Embarcadero . . .Dev-C++ keeps the console open by default:Hello, World!--------------------------------Process exited after 0.02145 seconds with return value 0Press any key to continue . . .Quote from: Dev-C++ Help

author: djsb
author_rank: Super Contributor
timestamp: December 29, 2021, 07:24:54 pm
content: Just to mix it up a little, I'm giving Visual Studio Community 2022 a go. This is mainly because the book mentioned earlier uses FLTK for it's GUI examples later on and FLTK comes with ready-made solution files for Visual Studio.Visual Studio really isn't so scary once you give it a try. I'm going to give the hello_world example a spin and see how I get on.PS The hello_world example from chapter 2 of the book compiles OK and shows the message in a popup window in VS 2022. I didn't even have to explicitly tell the IDE where to find the header file. It just found it itself.https://bumpyroadtocode.com/2017/08/29/how-to-install-and-use-fltk-1-3-4-in-visual-studio-2017-complete-guide-2-0-no-cross-contamination/https://stackoverflow.com/questions/70401545/how-to-use-fltk-graphic-library-with-visual-studio-community-2022-for-c-proj

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 29, 2021, 07:45:30 pm
content: Quote from: Ian.M on December 29, 2021, 05:56:09 pmYeah. OTOH, VS build tools for C and C++ (so only the command-line tools): 2.6 GB. =)

author: Siwastaja
author_rank: Super Contributor
timestamp: December 29, 2021, 08:30:20 pm
content: Quote from: nctnico on December 29, 2021, 04:55:49 pmMe too, we all have those moments. It only becomes an issue if you get fixated on the problem so much that just solving it is not enough. This is where people deal with differently. Some will act like this, "oh I see, there was this box to tick, me stupid, d'oh." Others will go, "oh I see, there was this box to tick, what crappy UI design, d'oh". I'm in the latter, but both will work if you just can go on.But if you decide to give up because of this and go on ranting about it on the Interwebz, you are just wasting your own time; you could be learning C++ instead.Learninganyprogramming language usinganytoolset is full of moments like this. If you get stuck for longer than a few hours on them, if they become your painpoints which require lengthy discussions, reaching your actual target is doomed.Really, most important is just keep the ball rolling. Pick any tool. Heck, even use STM32CubeIDE and Arduino I supposedly so much hate. Use nctnico's favorite, Eclipse, which I also hate, but it's really fine. They are all good enough tools that get the job done.

author: nctnico
author_rank: Super Contributor
timestamp: December 29, 2021, 09:52:10 pm
content: Actually... if you install GCC for WIndows (Mingw is the best choice IMHO) then STM32CubeIDE will also work for creating programs that run on a PC. After all STM32CubeIDE is just Eclipse with a piece of ST wallpaper stuck onto it.As a choice of IDE I'd advise to look into Visual Studio code nowadays. I see a lot of programmers around me (with ages from below 20 to over 80) using Visual Studio code. There is also a large ecosystem with plugins for VS code and for some languages (VHDL for example) already more choices than ever existed for Eclipse. It wouldn't surprise me if MCU vendors are switching to it as well in the near future. All in all I have a strong feeling the days of Eclipse are numbered.

author: Simon
author_rank: Unknown
timestamp: December 29, 2021, 10:42:52 pm
content: Quote from: nctnico on December 29, 2021, 03:34:44 pmThe book is for C++14 and I think maybe a bit beyond. It is just that it started life in it's first edition earlier and I suspect that is why the comment about 2005 was dropped as they anticipated more editions and that the IDE would change.How much of the original remains versus new material in the second edition I don't know.

author: IanB
author_rank: Super Contributor
timestamp: December 29, 2021, 11:23:04 pm
content: Quote from: Siwastaja on December 29, 2021, 08:30:20 pmThis is really a matter of your perspective on the task at hand. Whether you want torunyour program, or whether you want todebugit. If you are simply running the program, you do most likely want to see the output in the console window. However, if you are debugging it, it would be a pain to have to keep closing the console window every time you stop debugging.Both options are present on the Debug menu:

author: gmb42
author_rank: Frequent Contributor
timestamp: December 29, 2021, 11:58:36 pm
content: Quote from: dunkemhigh on December 29, 2021, 05:25:37 pmAs noted elsewhere, the size of the actual IDE portion of that download is relatively small, it's all the toolchain bits that make up the majority for x86, x64, all the Windows headers, debuggers, Windows SDK's.

author: Vtile
author_rank: Super Contributor
timestamp: February 06, 2022, 05:25:16 pm
content: For number 4. One could include a "wait key press" instruction as the last line of the code snippet, if there is no instruction which waits user interaction.I do not have a word for other numbers as I do try to stay away C(++) toolchain acrobacy. Years ago there was devc++ ide for windows, maybe it is still maintained.Edit. Didn't notice that there is 4 pages, mobile version of site is not the most informative one.

author: rstofer
author_rank: Super Contributor
timestamp: February 08, 2022, 03:29:52 am
content: I bought the Fourth Edition of Stroustrup's "The C++ Programming Language" book. It's a big heavy thing, 1345 pages!I am going to make one last ditch effort to learn enough of the language to more or less 'like' it. This isn't my first attempt, I have been trying to like it for 20 years or so. I just don't see the advantages and that's probably because my projects are small. I like C, I really prefer Fortran if the application is number crunching and Pascal is my all-time favorite for application programming.I have an old Dell Inspiron laptop and I just installed Mint Linux with the Cinnamon desktop. I'll use 'gedit' for the editor (with Alt-Y to shut off syntax coloring) running in one terminal and build/execute the code from a second terminal and the command line. This is a simple and effective way to develop code on Linux. I may progress to using Makefiles but they probably aren't necessary for book examples. I do know how to use 'make' so if it comes up there won't be too many stumbling points.If I'm going to write command line code, I really prefer to do it on Linux. Sure, I have Visual Studio and it works fine but it seems a little heavy for snippets of code. 'gedit' is a fine editor when the alternative is 'vi' or 'nano'. 'geany' is another fine editor. I think Eclipse would be overkill for this evolution but I like the fact it keeps track of projects in a workspace. It has improved greatly over the years.If I change my mind and use Win10, I will definitely use Visual Studio. It creates a project template as a starting point for every project. Visual Studio works very well and I don't find it terribly unwieldly.If I install VNC Server on the laptop, I can just let the laptop sit on a shelf in the back room and interact with is using VNC Client from my Win10 workstation (or any other machine). This works quite well and I do it all the time with Raspian on the Raspberry PI.Actually, an Intel NUC would be perfect for this application. Maybe later on...So many choices...

author: DiTBho
author_rank: Super Contributor
timestamp: February 08, 2022, 03:58:44 am
content: .. is there anything that doesn't require {GTK2, GTK3, kde}?anything (open)motif-based?Yes! despite being a minimalistMotif/X11plain text editor,NEditfeatures significant support for programmers including syntax highlighting, macro language, and streamlined keyboard navigation.I like NEdit combined with auto-tag, this way it automatically generates tags to bookmark functions.I will integrate Scintilla some day ...Anyway, it flawlessly works with C, but it's rather clumsy with C++

author: ledtester
author_rank: Super Contributor
timestamp: February 08, 2022, 06:22:19 am
content: Quote from: rstofer on February 08, 2022, 03:29:52 amDepending on your goals you might consider starting with Stroustrup's "A Tour of C++".C++ has a a long history and it's encumbered with a lot of "baggage" so to speak. The the thinking on best practices in C++ has evolved quite a bit over the years. I've heard the leaders of C++ (Bjarne, Herb Sutter, et. al.) express the sentiment that they feel there is a much simpler language that is struggling to express itself within C++.The CppCon talks on youtube are a good way to keep abreast of how this modern view of C++ is evolving - especially the ones by Bjarne and Herb.

author: Simon
author_rank: Unknown
timestamp: February 08, 2022, 07:56:01 am
content: Quote from: ledtester on February 08, 2022, 06:22:19 amI have that book too but clearly not a book for a beginner like me as you need a thorough background in programming.

author: m98
author_rank: Frequent Contributor
timestamp: February 08, 2022, 01:52:37 pm
content: I can recommend JetBrains CLion if a commercial IDE is an option. Quite intuitive to learn, works nice with CMake and is also great for embedded.

author: Simon
author_rank: Unknown
timestamp: February 08, 2022, 02:00:09 pm
content: Just need something that when I compile a program and it does not work I know it is because of my code and not some sillyness in the IDE.Going to build a separate machine to run Linux on so maybe I'll get more sense on that.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: February 08, 2022, 03:57:59 pm
content: Quote from: Simon on February 08, 2022, 02:00:09 pmNeovim. Thank me later.No really. Give it a day and fall in love.

author: Ed.Kloonk
author_rank: Super Contributor
timestamp: February 08, 2022, 10:23:28 pm
content: Quote from: alexanderbrevig on February 08, 2022, 03:57:59 pmInteresting project.

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: August 02, 2022, 02:33:59 pm
content: Quote from: SiliconWizard on December 24, 2021, 07:27:49 pmDespite VS not being wanted I would totally disagree with that stance.VS is an incredible piece of software with intellisense to guide you.I have used it for 20 years and done some huge programs with it.

author: emece67
author_rank: Frequent Contributor
timestamp: August 02, 2022, 03:29:55 pm
content: .

author: rstofer
author_rank: Super Contributor
timestamp: August 02, 2022, 03:33:26 pm
content: Quote from: Simon on February 08, 2022, 02:00:09 pmLinux is a great development environment. Get pretty good with makefiles and you can build some large projects with files in separate directories and all that kind of thing. The problem is, Linux may not be the target. If Windows comes into the deal at all, it is probably better to develop on Windows and the Visual Studio Code (and let's be clear, this isn't Visual Studio with all the compilers and such) is a pretty nice IDE. There is a difference between Visual Studio and Visual Studio Code although the IDE portion of Visual Studio looks a lot like Visual Studio Code.Mostly, we build console apps (at least that is the case for me) and those will run in the terminal window of VSC where you can see the results and any error messages. And, yes, they will be YOUR errors, not the IDEs. You have to figure that the millions of people using VSC will have discovered any issues long before you came to play.I also like Eclipse, mainly because it has a Fortran plug-in. Again, the command line output is at the bottom of the screen. This is a very workable IDE and used by MANY programmers.

author: nctnico
author_rank: Super Contributor
timestamp: August 02, 2022, 03:51:44 pm
content: VS Code seems to be the popular IDE 'du jour' but what I like about Eclipse CDT is that it has many goodies out of the box. In order to get the same level of functionality from VS code, you'll need to install several plugins for which you need to know which ones are good and which aren't. Not very helpfull if you are a novice.

author: rstofer
author_rank: Super Contributor
timestamp: August 02, 2022, 04:05:17 pm
content: On Linux, I use gedit or geany as the editor and a separate terminal for build and execution. So, two windows open on the screen. It doesn't get easier than this.The Raspberry Pi makes a pretty decent Linux environment and a Pi 400 is very convenient if desk space is available. The cool part is to set up VNC and run the whole Linux process from a Windows workstation, graphics desktop and all. Running a Pi headless is very workable and there is no reason to give up desk space for another monitor/keyboard/mouse setup. Getting started may require a monitor/keyboard/mouse or not. If you can use a wired network connection (because the new headless Pi won't have the WiFi ssid/password) and your router will give you the IP address, you can even start headless. Search Google for ideas about getting the Pi IP address. Turns out my HP desktop has HDMI input so I can use the same display for the All-In-One or the Pi. Still have to diddle around with the keyboard/mouse. I guess I could use a KVM switch but I'm lazy. I only need the Pi keyboard/mouse for a couple of minutes to set up WiFi and VNC.

author: eti
author_rank: Super Contributor
timestamp: October 12, 2022, 06:44:30 pm
content: I use Ubuntu as my OS. I installed Windows 10, 2 days ago, to write a C# forms application... wow... the amount of time it took to JUST get the OS to behave, to ACTUALLY SHUTDOWN (messed around with the"Intel Management Engine Interface"driver for over an hour and the machine still wouldn't power off, black screen, fans whizzing) - then the next day, just as I was doing somethingit shut itself down!So yeah, a vote for Linux is a deffo! g++ for the win!

author: JPortici
author_rank: Super Contributor
timestamp: October 14, 2022, 04:56:25 am
content: Uh, i missed this.If i had to i'd use the Qt Ide, but that's because i'm already using Qt so i have the IDE, compiler, debugger already in place. In Qt i can create a c++ project without using a single Qt feature if i want toEarlier i would have used visual c++. Same reason, i was already using C# to do .net applications so i already had visual studio installedGeneric IDE, probably eclipse for as much as i dislike eclipse it just works(tm) for C++, or VSCode if i ever manage to understand how to make it work like an ide and interact with a debugger

author: orb
author_rank: Regular Contributor
timestamp: January 12, 2023, 09:34:38 am
content: Windows: you can use cygwin + notepad++.Linux: gcc + geany.Android: termux (clang) + quickedit.Termux is a very powerful environment, I use it for python too. I used VS a long time ago, because it is a good option for programming in the windows api.

author: Ian.M
author_rank: Super Contributor
timestamp: January 12, 2023, 10:19:13 am
content: Caution:Cigwyn (and also various GCC based toolchains) can break totally unrelated Windows CMD scripts (.bat, .cmd). The culprit is often the FIND command, which has very different syntax in its Linux and Windows command line versions. You can reorder the path so the Windows version comes first, but that will break any shell script that is expecting Linux FIND syntax.After wasting an afternoon debugging such a CMD script that had mysteriously broken since I last used it some 15 month earlier, I ended up replacing all occurrences offindin it with%SystemRoot%\System32\findto explicitly invoke the Windows version!

author: Sherlock Holmes
author_rank: Frequent Contributor
timestamp: January 12, 2023, 05:30:49 pm
content: Quote from: Simon on December 24, 2021, 11:41:26 amVisual Studio is a superb application though, very very robust, very well maintained, runs on Mac too. The overall robustness, cutting edge extension support and powerful debugging of multithreaded and asynchronous code is just win-win-win.The community edition is free too!

author: IanB
author_rank: Super Contributor
timestamp: January 13, 2023, 02:24:30 am
content: Quote from: Ian.M on January 12, 2023, 10:19:13 amHere is a useful little command script to help with this situation. It reproduces the Unix "which" command by telling you which program will run when you enter a command, for example:Code:C:\Temp>which notepadC:\Windows\System32\notepad.exeC:\Temp>which findC:\Windows\System32\find.exeC:\Temp>which clC:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\Hostx86\x86\cl.exeC:\Temp>which perlC:\Strawberry\perl\bin\perl.exeC:\Temp>which whichC:\Tools\which.cmdC:\Temp>The script is listed below. Place it in a file called "which.cmd" and place it somewhere suitable in your path. I like to use C:\Tools for this kind of thing.Code::: which.cmd:::: Locates which version of a command will run given the current search path::@echo offsetlocal enableextensionsset command=%1if "%command:~0,1%"=="/" (echo Finds and prints the location of the program that will execute a given commandecho given the current search path. Convenient to find out if the expected versionecho of a command is the one that will run.echo.echo WHICH echo.echo For example,echo.echo which notepadecho.echo will likely displayecho.echo C:\Windows\System32\notepad.exeexit /b 0)if "%command%"=="" (echo Usage: which commandexit /b 0):::: Set things up::set extlist=%pathext%set found=falseset localpath=%cd%;%path%:::: Loop over all possible command extensions:::extloopif "%extlist%"=="" exit /b 1call :getnextcall :lookforit %command%%ext%if %found%==true exit /b 0goto :extloop:::: Subroutine to get next available command extension from list:::getnextfor /f "delims=; tokens=1,*" %%i in ("%extlist%") do (set ext=%%iset extlist=%%j)goto :eof:::: Subroutine to locate a given command+extension in the search path:::lookforitset fullpath=%~$localpath:1if "%fullpath%"=="" goto :eofecho %fullpath%set found=truegoto :eof