Programming:C++/Books/You Can Do It!: A Beginners Introduction to Computer Programming

From WhyAskWhy.org Wiki
< Programming:C++‎ | Books
Revision as of 12:42, 28 July 2012 by Deoren (talk | contribs) (Fixed syntax)
Jump to: navigation, search


These are my notes from You Can Program in C++: A Programmer's Introduction [1].



Much of the following content has been ported over with little correction from its original source. The directions may contain broken links and may also refer to older software or operating systems that are no longer supported by their respective vendors. If you have specific questions, please contact me via Twitter and I'll try to help you out.



About the book

I'll attempt to give proper remarks for this book later, but suffice to say this book is well worth your time if you're learning C++. I like how Francis pays particular attention to the pitfalls of the language. He teaches you to always check for failing function calls (something a lot of "beginner books" fail to do) and teaches you how to use strings and vectors from the beginning in place of arrays.


Getting by without the cd

If you're like me and checked this out from the library you probably did not get a copy of the cd. I visited the book's website [2] and downloaded the material from there. What didn't work for me was the link to Quincy 2002.

Instead I visited Google and searched for it. I found that Quincy 2005 was available so I grabbed that. Thankfully Francis made the source for the graphics library used in the book available so it could be compiled for other versions of Mingw and even different tool-kits entirely.


Make sure to keep a copy of the fgwlib.zip file in a safe location in case you mess up any of the steps. This way you can unzip it and try again.


Building the fgw library for use with Quincy 2005

  1. Download Quincy 2005 v1.3 and install it.
  2. Download all archives from the book's website [2].
  3. Run tutorial.exe, extract to the folder where the tutorial already resides. It should create a folder called tutorial. For the rest of the directions I'll refer to this folder as the tutorial folder. I'll pretend it's located at C:\Documents and Settings\deoren\Desktop\ycdi_files
  4. Open the tutorial folder and look for a fgw_headers folder.
  5. Copy C:\Program Files\quincy\mingw\lib\COMPLETE_THIS_PATH\libgdi32.a and replace the libgdi32.a file within the fgw_headers folder.
  6. Extract fgwlib.zip and copy the updated fgw_text.h header file to fgw_headers. Choose to overwrite the older file.
  7. Extract library_source.zip. This should give you a folder called source4net.
  8. Open a command prompt (Start->Run->cmd->Enter)
  9. set path=%path%;C:\Program Files\quincy\mingw\bin
  10. cd C:\Documents and Settings\deoren\Desktop\ycdi_files\source4net
  11. make
  12. Copy libfgwz.a to fgw_headers
  13. Delete fgwlib.a so there is no confusion which file to add to your projects.
  14. Every time the book tells you to add fgwlib.a to your project, add your newly compiled libfgwz.a instead.


Building the fgw library using the latest MinGW and MSYS tools

  1. Download and install the latest MinGW and MSYS tools
  2. Either permanently modify the PATH variable, or temporarily modify it with set PATH=%PATH%;C:\MinGW\bin;C:\MinGW\msys\1.0\bin
  3. cd \tutorial\fgw_headers
  4. rmdir /s /q Release
  5. mkdir Release
  6. bash
  7. make
  8. cp Release/libfgwz.a .
  9. Configure IDE as appropriate