• «
  • 1
  • 2

Frequently Asked Questions

for

C++ for Dummies, 6th Edition

The current version of "C++ for Dummies" is 6th edition.

Click  for errata on the 5th Edition and  to go to the errata page for the now dated 4th Edition.

Q: The book said something about 'bonus material'. Where can I download the bonus material?

A: Right !

Q: The first time I build my program with Code::Blocks I get the following error message: "...uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping... Nothing to be done" What's wrong?

A: (Windows) The Code::Blocks package first installs the GNU C++ compiler. It then installs the Code::Blocks editor that looks for a compiler to connect to. If you already have a C++ compiler installed on your machine, Code::Blocks can find that other compiler instead of the one it installed.

There are two solutions. The best solution is to uninstall Code::Blocks and then uninstall the "other" C++ compiler. Finally reinstall Code::Blocks. Without the other C++ compiler, it should now find the proper compiler and work properly.

A second approach is to redirect Code::Blocks to the GNU C++ compiler. To do this, select "Settings" then "Compiler and Debugger...". From there, select the "Toochain executables" to C:\Program Files\CodeBlocks\MinGW (this is the default location where CodeBlocks installs the C++ compiler on a Windows machine).

Note:For Windows 7, the default path is C:\Program Files (x86)\CodeBlocks\MingGW.

You can easily check this yourself. Open Windows Explorer. Look in C:\Program Files\CodeBlocks or C:\Program Files (x86)\CodeBlocks. Then check for a subdirectory MingGW. If it's not there, then you didn't install the GCC compiler. If it is, look for a subdirectory bin that includes a ton of executables including gcc.exe.

Enter the proper path to the MingGW. You're display should look like the following.

Select OK to save the result and retry.

(Mac OS, Linux) The Code::Blocks package for Macintosh does not automatically install GCC - you'll have to do that yourself. However, there are instructions for doing that at. Once you've installed GCC, you can install Code::Blocks and it should work fine.

Q: I get an error message that Code::Blocks can't create the object file. What's wrong?

A: One of two things:

a) Either you are trying to build the files directly on the CD-ROM or

b) You have spaces in the source directory (perhaps you put your project on the desk top)?

Q: I bought "C++ for Dummies" for Kindle. Is there some place that I can download the programs from the CD-ROM?

A: You can download the C++ source files from . The .zip file and the .rar file are both the source files along with the project files to compile them in Code::Blocks. (They have the same content.) The setup.exe is the version of Code::Blocks for Windows that came with the book. You can also download just the CodeBlocks that came with the book at . You can download other versions of Code::Blocks at .

Page 116: In the code snippet on top of the page:

nVar = &nVar;

should obviously read

pnVar = &nVar;

Page 151: The code snippet says:

int i = 2;

cout << "i = " << i << endl;

int nSQ = SQUARE(i++);

cout << "SQUARE(i++) = " << nSQ << endl;

cout << "now i = " << i << endl;

It should start

int i = 3;

Часто задаваемые вопросы

для

C + + для чайников, 6-е издание

Текущая версия "C + + для чайников" является 6-е издание.

Нажмите  для опечаток на 5th Edition и  , чтобы перейти на страницу исправлений для теперь от 4-е издание.

Вопрос: В книге сказал что-то о "бонусного материала». Где я могу скачать бонусный материал?

: Право  !

Вопрос: В первый раз я строить свою программу с Code :: Blocks я получаю следующее сообщение об ошибке:.?! "... использует недопустимый компилятора Вероятно, путь инструментарий в рамках опций компилятора не настроено правильно Пропуск ... Ничего быть сделано "Что случилось?

: (Windows) Пакет Code :: Blocks сначала устанавливает C + + компилятор GNU. Затем он устанавливает редактор Code :: Blocks, который ищет компилятор для подключения. Если у вас уже есть C + + компилятор установленной на вашем компьютере, Code :: Blocks можете обнаружить, что другой компилятор вместо той, которую она установлена.

Есть два решения. Лучшим решением будет удалить Code :: Blocks, а затем удалить "другую" компилятор С + +. Наконец переустановить Code :: Blocks. Без другой компилятор С + +, он должен теперь найти подходящий компилятор и нормально работать.

Второй подход является перенаправление Code :: Blocks в C + + компилятор GNU. Чтобы сделать это, выберите "Настройки", затем "компилятора и отладчика ...".Оттуда, выберите "Toochain исполняемые" в C: \ Program Files \ CodeBlocks \ MinGW (это расположение по умолчанию, где CodeBlocks устанавливает C + + компилятор на машине Windows).  Примечание: Для Windows 7, путь по умолчанию C: \ Program Files (x86) \ CodeBlocks \ MingGW. Вы можете легко проверить это самостоятельно.Откройте Проводник Windows. Посмотрите в C: \ Program Files \ CodeBlocks или C: \ Program Files (x86) \ CodeBlocks. Тогда проверьте подкаталоге MingGW. Если его там нет, то вы не установили компилятор GCC. Если это так, искать подкаталога бен который включает тонну исполняемых в том числе gcc.exe. Введите правильный путь к MingGW. Ты Дисплей должен выглядеть следующим образом. Выберите OK, чтобы сохранить результат и повторите попытку. (Mac OS, Linux) Код :: пакет Блоки для Macintosh не устанавливается автоматически GCC - вам придется сделать это самостоятельно. Однако, есть инструкции по выполнению, что в  . После установки GCC, вы можете установить Code :: Blocks и он должен работать нормально.