<p>Do it in two steps: There are resources for each part.</p>

<ul>
<li>Start by learning how to compile, link, run code, and launch the debugger, from the command line.</li>
<li>Then learn how to write make files.</li>
</ul>

<p>You should also read <a href="http://aegis.sourceforge.net/auug97.pdf" rel="nofollow noreferrer">Recursive Make Considered Harmful</a> by Peter Miller. It should direct you away from a lot of common bad practice. When I applied what I learnt from it, to re-right a make file, with the intention to make it simpler, so that it would be easier to add to. It also became twice as fast (but that is not the reason to read this).</p>

CC BY-SA 4.0
2019-09-27T19:43:41.727Z
2019-09-28T13:29:41.130Z
2019-09-28T13:29:41.130Z
ctrl-alt-delor
<p>This answer is based on the assumption that you are a competent programmer, but want to improve your C++ and learn how to design and write larger scale programs. I find the best way to start is to imitate something existing. This means reading code. Another tool you didn't mention, but which will be part of a project, is for source code control (likely <code>git</code>).</p>

<p>As a learning tool for understanding C++ development I would suggest that you find an open source c++ project on a topic of some interest to you. You don't have to contribute to the project, but simply use it as a guide on how large scale projects are structured.</p>

<p>Down load the source per the instructions and practice "building" the project. Now you are ready to study the structure of the project. It is likely made up of many files, distributed over a number of directories. Each logical piece may have a <code>Makefile</code> associated with it controlled by higher level <code>Makefiles</code>. 
Begin by examining the directory and file structure and understanding how it was decomposed into pieces. You don't have to understand every piece, but rather get a feel for the overall structure. Of course this is only the structure the authors came to use and may be different for other projects. Things to notice are whether the structure places headers and source in the same or different directories and whether the .o are in separate directories. Are .o files linked into libraries or used directly? Look for the <code>Makefiles</code> and study how they are structured to build things based on the actual structure. You many find that the project may be built in different ways (e.g. debuggable or optimized, etc). Study how those choices are reflected in the <code>Makefiles.</code> You will likely be doing a lot of reading of manuals for Make and reading answers in stackoverflow.</p>

<p>Projects will likely contain resources for testing a build. Study the methodologies used and how they are incorporated into the project. They are also likely to contain the means to distribute a "new" version, either as source or as a binary. Again, study the options and try to understand the processes involved.</p>

<p>If you are looking for advanced C++, you could look at the <code>Boost</code> sources and understand what they did in building various C++ libraries. </p>

<p>As you begin to understand projects, take ideas and apply them to something you want to work on. Begin small and add ideas as you learn. Study other projects in the same way to become familiar with other arrangements. You goal is to learn what techniques to employ in various situations so that you can choose what is appropriate for your work.</p>

CC BY-SA 4.0
2019-09-06T22:00:00.557Z
2019-09-06T22:00:00.557Z
Fritz Sieker
<p>For <code>make</code> consider <a href="https://www.oreilly.com/openbook/make3/book/index.csp" rel="nofollow noreferrer">O'Reilly book</a>. It is a perfect intro. Honest to goodness.</p>

<p>The <a href="http://shop.oreilly.com/product/9780596100278.do" rel="nofollow noreferrer">GDB</a> one is not so much an educational tool, it is a reference, but I doubt you'd find anything which would teach you how to use GDB any better. The GDB learning curve is short and easy.</p>

<p>I also doubt that there is a resource dedicated to <code>gcc</code> any better than the online documentation.</p>

<p>As for the C++ language I strongly recommend the foundational classics by Stroustrup (try <a href="http://www.stroustrup.com/programming.html" rel="nofollow noreferrer">Principles and Practice</a> for starters and see how it goes).</p>

<p>PS: your request seems to be well aligned with <a href="https://rads.stackoverflow.com/amzn/click/com/013937681X" rel="nofollow noreferrer" rel="nofollow noreferrer">another classic</a>. Never mind it was published in 1984. Still very much applicable.</p>

CC BY-SA 4.0
2019-08-30T21:14:05.083Z
2019-08-30T21:25:04.250Z
2019-08-30T21:25:04.250Z
user58697
<p>About me: I started development in python. I consider my self as an intermediate Vim user. I am comfortable with many bash shell commands. For all the python projects (like django or numerical optimization related), I simply open multiple terminals in i3 and then edit different files using vim and get things done.</p>

<p>Here is a fact about me, I have never done project development in C++ ( long back I did write some single source code file in C, but that is all). I would like to develop some expertize in doing C++ based project development using command line interface (no IDE for sure). I know that there will be an addition compiling and linking overhead (this is where python is so good).</p>

<p>I need to learn some tools which will allow me which help me to create good workflow ( or say environment ) to do development of C++ based projects using cli (command line interface). I suspect that the 3 tools which are must for me to create such cli (terminal) based workflow are :</p>

<ul>
<li><p>a compiler ( gcc)</p></li>
<li><p>gdb for debugging via command line</p></li>
<li><p>make ( for build automation)</p></li>
</ul>

<p>Can anyone refer me to a book ( or any other resource like online courses, videos, blogs ) which would help me to learn those tools for building a terminal based workflow and would teach me some C++ language itself ?</p>

<p>Note1: Most of the C++ books I found online would simply teach C++ development using some IDE, I have not found a single book which teaches C++ development using make and gdb (or any other command line tools).</p>

CC BY-SA 4.0
2019-08-24T20:58:29.797Z
Welcome to [cseducators.se] I suspect that such a resource doesn't exist. Educational materials tend to go the easy way and use the IDE so that the students can focus on the language, not the workflow. Developing a CLI workflow is probably more of a personal preference than a standard to disseminate.
Gypsy Spellweaver
CC BY-SA 4.0
2019-08-24T21:59:58.030Z
Your requirements seem inconsistent. You want "terminal based" but also "tools". If I suggest emacs you will hate me, of course.
Buffy
CC BY-SA 4.0
2019-08-24T22:37:32.203Z
@Buffy why should this be inconsistent? There are command line tools as well...
csabinho
<self-learning><resource-request><c++>
Tell me a book ( or resources) for creating a good terminal based workflow (for building, debugging) for c++ based project development
# Tell me a book ( or resources) for creating a good terminal based workflow (for building, debugging) for c++ based project development

(Asked by: username_0 on 2019-08-24)

About me: I started development in python. I consider my self as an intermediate Vim user. I am comfortable with many bash shell commands. For all the python projects (like django or numerical optimization related), I simply open multiple terminals in i3 and then edit different files using vim and get things done.

Here is a fact about me, I have never done project development in C++ ( long back I did write some single source code file in C, but that is all). I would like to develop some expertize in doing C++ based project development using command line interface (no IDE for sure). I know that there will be an addition compiling and linking overhead (this is where python is so good).

I need to learn some tools which will allow me which help me to create good workflow ( or say environment ) to do development of C++ based projects using cli (command line interface). I suspect that the 3 tools which are must for me to create such cli (terminal) based workflow are :

* a compiler ( gcc)
* gdb for debugging via command line
* make ( for build automation)

Can anyone refer me to a book ( or any other resource like online courses, videos, blogs ) which would help me to learn those tools for building a terminal based workflow and would teach me some C++ language itself ?

Note1: Most of the C++ books I found online would simply teach C++ development using some IDE, I have not found a single book which teaches C++ development using make and gdb (or any other command line tools).

**Tags:** self-learning, resource-request, c++

> **Comments:**
> **username_1**: Welcome to [cseducators.se] I suspect that such a resource doesn't exist. Educational materials tend to go the easy way and use the IDE so that the students can focus on the language, not the workflow. Developing a CLI workflow is probably more of a personal preference than a standard to disseminate.  
> **username_2**: Your requirements seem inconsistent. You want "terminal based" but also "tools". If I suggest emacs you will hate me, of course.  
> **username_3**: @username_2 why should this be inconsistent? There are command line tools as well...  

---

## 3 answers

### Answer by username_6 on 2019-08-30. Score: 3 | Accepted answer

For `make` consider [O'Reilly book](https://www.oreilly.com/openbook/make3/book/index.csp). It is a perfect intro. Honest to goodness.

The [GDB](http://shop.oreilly.com/product/9780596100278.do) one is not so much an educational tool, it is a reference, but I doubt you'd find anything which would teach you how to use GDB any better. The GDB learning curve is short and easy.

I also doubt that there is a resource dedicated to `gcc` any better than the online documentation.

As for the C++ language I strongly recommend the foundational classics by Stroustrup (try [Principles and Practice](http://www.stroustrup.com/programming.html) for starters and see how it goes).

PS: your request seems to be well aligned with [another classic](https://rads.stackoverflow.com/amzn/click/com/013937681X). Never mind it was published in 1984. Still very much applicable.


---

### Answer by username_4 on 2019-09-27. Score: 4

Do it in two steps: There are resources for each part.

* Start by learning how to compile, link, run code, and launch the debugger, from the command line.
* Then learn how to write make files.

You should also read [Recursive Make Considered Harmful](http://aegis.sourceforge.net/auug97.pdf) by Peter Miller. It should direct you away from a lot of common bad practice. When I applied what I learnt from it, to re-right a make file, with the intention to make it simpler, so that it would be easier to add to. It also became twice as fast (but that is not the reason to read this).


---

### Answer by username_5 on 2019-09-06. Score: 2

This answer is based on the assumption that you are a competent programmer, but want to improve your C++ and learn how to design and write larger scale programs. I find the best way to start is to imitate something existing. This means reading code. Another tool you didn't mention, but which will be part of a project, is for source code control (likely `git`).

As a learning tool for understanding C++ development I would suggest that you find an open source c++ project on a topic of some interest to you. You don't have to contribute to the project, but simply use it as a guide on how large scale projects are structured.

Down load the source per the instructions and practice "building" the project. Now you are ready to study the structure of the project. It is likely made up of many files, distributed over a number of directories. Each logical piece may have a `Makefile` associated with it controlled by higher level `Makefiles`.
Begin by examining the directory and file structure and understanding how it was decomposed into pieces. You don't have to understand every piece, but rather get a feel for the overall structure. Of course this is only the structure the authors came to use and may be different for other projects. Things to notice are whether the structure places headers and source in the same or different directories and whether the .o are in separate directories. Are .o files linked into libraries or used directly? Look for the `Makefiles` and study how they are structured to build things based on the actual structure. You many find that the project may be built in different ways (e.g. debuggable or optimized, etc). Study how those choices are reflected in the `Makefiles.` You will likely be doing a lot of reading of manuals for Make and reading answers in stackoverflow.

Projects will likely contain resources for testing a build. Study the methodologies used and how they are incorporated into the project. They are also likely to contain the means to distribute a "new" version, either as source or as a binary. Again, study the options and try to understand the processes involved.

If you are looking for advanced C++, you could look at the `Boost` sources and understand what they did in building various C++ libraries.

As you begin to understand projects, take ideas and apply them to something you want to work on. Begin small and add ideas as you learn. Study other projects in the same way to become familiar with other arrangements. You goal is to learn what techniques to employ in various situations so that you can choose what is appropriate for your work.


---

