You cannot get much simpler than the free Arduino IDE .
Are you intending to use the Arduino chips/boards or some other micros ?
Visual Studio or Visual Studio Code
Visual Studio or Visual Studio Code
Next time read the post!
Visual Studio or Visual Studio Code
Next time read the post!
Maybe command line compiling is the best option for this sort of thing.
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 have https://github.com/mirai-computing/cbp2make (https://github.com/mirai-computing/cbp2make) that 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
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 have https://github.com/mirai-computing/cbp2make (https://github.com/mirai-computing/cbp2make) that 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
That made no sense to me at all. To restate for those running away with themselves:
1) i have a book
2) it has exercises that need to be compiled and run on a console
3) the IDE recomended does not really exist anymore
4) 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.
4) 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.Every 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.
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.
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 warnings
b) Use cppckeck https://cppcheck.sourceforge.io (https://cppcheck.sourceforge.io)
c) Use splint https://splint.org/ (https://splint.org/) (Only C)
d) Run your program with Valgrind https://valgrind.org (https://valgrind.org)
e) Debug your program with gdb (which has support for many embedded micros).
All these suggestions are also valid for embedded development.
1) i have a book
2) it has exercises that need to be compiled and run on a console
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.
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.
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 warnings
That made no sense to me at all. To restate for those running away with themselves:
1) i have a book
2) it has exercises that need to be compiled and run on a console
3) the IDE recomended does not really exist anymore
4) 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.
Quick question.
Does anybody use Kdevelop anymore?
That made no sense to me at all. To restate for those running away with themselves:
1) i have a book
2) it has exercises that need to be compiled and run on a console
3) the IDE recomended does not really exist anymore
4) 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.
Did 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.
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?No. 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.
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.
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.
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.
Except... 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.
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.
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.
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.
You can build C and C++ applications on the command line by using tools that are included in Visual Studio. The Microsoft C++ (MSVC) compiler toolset is also downloadable as a standalone package. You don't need to install the Visual Studio IDE if you don't plan to use it.
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.
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.
And 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.
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 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.
I 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
Don'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.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.
FFS 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.
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.
C.4 Later
The IDE has an apparent infinity of features and options. Don’t worry about
those early on — or you’ll get completely lost. If you manage to mess up a project
so that it “behaves oddly,” ask an experienced friend for help or build a new project
from scratch. Over time, slowly experiment with new features and options.
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?Me 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.
Here it goes:
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.
Hello, World!
--------------------------------
Process exited after 0.02145 seconds with return value 0
Press any key to continue . . .
Q: Programs created with Dev-C++ show the line "Process exited with return value X". What's going on?
This piece of text is shown when a console program ran via Dev-C++ exits. The host that runs your console program (ConsolePauser.exe) prints this code. Dev-C++ does NOT add any code to your programs to print this. This feature is quite useful because you can see console output before closing. You can remove it by unticking "Tools >> Environment Options >> General >> Pause console programs after return".
Orwell Dev-C++ installer 50,433,966 bytes (48 MB)
TDM-GCC 10.3.0 full installer 80,474,875 bytes (76.7 M)
Total 130,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 . . .
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?Me certainly.
The 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.Don'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.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.
FFS 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.
To get going with Visual Studio Code:
https://code.visualstudio.com/docs/setup/windows (https://code.visualstudio.com/docs/setup/windows)
https://code.visualstudio.com/docs/cpp/introvideos-cpp (https://code.visualstudio.com/docs/cpp/introvideos-cpp)
Found these with a website called Google.
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?Me certainly.
Me 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.
Here it goes:
Blimey!
I bought the Fourth Edition of Stroustrup's "The C++ Programming Language" book. It's a big heavy thing, 1345 pages!
Depending 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.
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.
Interesting project.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.
Neovim. Thank me later.
No really. Give it a day and fall in love.
VS may be fine but the OP explicitely stated that he didn't want it. This didn't look very hard to get. :popcorn:
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.
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.
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?
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. |O
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 of find in it with %SystemRoot%\System32\find to explicitly invoke the Windows version! :horse:
C:\Temp>which notepad
C:\Windows\System32\notepad.exe
C:\Temp>which find
C:\Windows\System32\find.exe
C:\Temp>which cl
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\Hostx86\x86\cl.exe
C:\Temp>which perl
C:\Strawberry\perl\bin\perl.exe
C:\Temp>which which
C:\Tools\which.cmd
C:\Temp>
:: which.cmd
::
:: Locates which version of a command will run given the current search path
::
@echo off
setlocal enableextensions
set command=%1
if "%command:~0,1%"=="/" (
echo Finds and prints the location of the program that will execute a given command
echo given the current search path. Convenient to find out if the expected version
echo of a command is the one that will run.
echo.
echo WHICH [command]
echo.
echo For example,
echo.
echo which notepad
echo.
echo will likely display
echo.
echo C:\Windows\System32\notepad.exe
exit /b 0
)
if "%command%"=="" (
echo Usage: which command
exit /b 0
)
::
:: Set things up
::
set extlist=%pathext%
set found=false
set localpath=%cd%;%path%
::
:: Loop over all possible command extensions
::
:extloop
if "%extlist%"=="" exit /b 1
call :getnext
call :lookforit %command%%ext%
if %found%==true exit /b 0
goto :extloop
::
:: Subroutine to get next available command extension from list
::
:getnext
for /f "delims=; tokens=1,*" %%i in ("%extlist%") do (
set ext=%%i
set extlist=%%j
)
goto :eof
::
:: Subroutine to locate a given command+extension in the search path
::
:lookforit
set fullpath=%~$localpath:1
if "%fullpath%"=="" goto :eof
echo %fullpath%
set found=true
goto :eof