<?xml version="1.0" encoding="US-ASCII"?>
<section xmlns="http://docbook.org/ns/docbook" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:ns5="http://www.w3.org/1998/Math/MathML" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:ns3="http://www.w3.org/2000/svg" xmlns:ns="http://docbook.org/ns/docbook" version="5.0" xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd" xml:id="problems" xml:lang="en-US">
  <title>Common Problems</title>
  <para>If you have followed these instructions everything should work.
  However, you may have ran into trouble, and then decided to look for the
  manual (at least, that's the way I would have done it). So now you have a
  problem and need an answer:</para>
  <para>Please note if you are reading the online version: Some problems may
  covered in a newer version of this document, please refer to <xref linkend="introduction"/>.</para>
  <section xml:id="common_errors">
    <title>How to fix most of the common errors on Windows</title>
    <para>Make sure you have done the following things:</para>
    <para>
      <itemizedlist>
        <listitem>
          <para>Installed the CDT</para>
        </listitem>
        <listitem>
          <para>Installed (not just downloaded) MinGW and MSYS with
          Administrator privileges</para>
        </listitem>
        <listitem>
          <para>Set up your path environment variable</para>
        </listitem>
      </itemizedlist>
    </para>
    <para>Especially made sure you did the last step. You
    <emphasis>will</emphasis> need to restart eclipse (full restart with
    shutdown, File / Restart is not sufficient). This solves about 99% of all
    support mails I've got so far.</para>
  </section>
  <section xml:id="lion">
    <title>How to fix most of the common errors on Lion (Mac OS X 10.7)</title>
    <para>Make sure you have done the following this:</para>
    <itemizedlist>
      <listitem>
        <para>Downloaded XCode from App Store</para>
      </listitem>
      <listitem>
        <para>Installed XCode using the "Install XCode button"</para>
      </listitem>
    </itemizedlist>
    <para>Both of these steps are important, in particular when you upgraded
    from an earlier version of Mac OS X. Upgrading to Lion breaks your
    existing developer tools! Read also the full description in <xref linkend="macosx"/>. It also covers problems during the XCode
    install.</para>
  </section>
  <section xml:id="nomake">
    <title>Build error (Exec error:Launching failed), CreateProcess: make -k
    all error=2,</title>
    <para>You have just tried the build the hello world program, and you get
    this error message instead of an executable. This means that
    <command>make</command> is not in your path. Open up a command prompt (In
    OS X: Terminal in Applications/Utilities, in Windows: Start/Run, type in
    cmd) and type in <command>make</command>. If that doesn't work, try
    <command>gmake</command>.</para>
    <para>If <command>gmake</command> worked, see <xref linkend="configuring"/>.</para>
    <para>If neither worked, make sure you install make (See <xref linkend="compiler"/>) and set your path (See <xref linkend="envwin"/> in
    the case of Windows).</para>
    <para>To check your path (on windows), open up <command>cmd</command> and
    type in <command>echo %path%</command>. This should show the path to MSYS
    and MinGW. Also, make sure that you restarted Eclipse (or cmd if you are
    testing) after setting your path.</para>
    <para>If you are on Windows, and you have installed MinGW, but not MSYS,
    you may have an executable called <command>mingw-make</command>. In this
    case you have to go to <xref linkend="configuring"/> and configure
    appropriately. It is possible to just use mingw-make and no MSYS at all,
    however, mingw-make has some limitations. Eclipse CDT managed makefiles
    may or may not work with it. Please see the <link xlink:href="http://www.mingw.org/mingwfaq.shtml#faq-mingw32-make.exe">MinGW
    FAQ</link> for more information.</para>
  </section>
  <section xml:id="external_scanner_info_generator">
    <title>/bin/sh: line 1: g++: command not found, Error launching external
    scanner info generator</title>
    <para>This error message means that g++ is either not installed or not in
    your path. Check your path settings as described in <xref linkend="nomake"/>, but this time try the commands: <command>gcc
    --version</command> and <command>g++ --version</command>. If gcc works,
    but g++ doesn't, it means you have only installed the C and not the C++
    version of the gcc compiler, which happens quite frequently on Linux
    distributions. Check if you have all needed packages installed, and check
    <xref linkend="compiler"/>.</para>
    <para>If you are on windows, and neither of them worked, install MinGW and
    set your path environment variable. If only gcc one worked, reinstall
    MinGW and don't forget to select the C++ compiler!</para>
  </section>
  <section xml:id="undefinded_symbols">
    <title>Undefined symbols for architecture x86_64 (OS X 10.7)</title>
    <para>Make sure you have done the steps in <xref linkend="lion"/>.</para>
    <para>If the problem still persist, and you are trying to compile C++
    code, make sure your source files actually have an extension of ".cc" or
    ".cpp".</para>
  </section>
  <section xml:id="no_output">
    <title>No output or only sometimes output</title>
    <para>If you are on windows and use Eclipse 3.1 with CDT 3.0.0 there is a
    bug. See <xref linkend="configuring"/>.</para>
    <para>Please note that debug sessions in Windows have their own console
    window (a black console window) and do not appear in the regular Eclipse
    console. If you're running a debug session, please watch which windows
    appear in your task bar.</para>
  </section>
  <section xml:id="error_launching_cygpath">
    <title>Error launching 'cygpath' command</title>
    <para>If you followed these instructions you have installed MSYS instead
    of cygwin. You may safely ignore this error message.</para>
  </section>
  <section xml:id="nocppproject">
    <title>I do not have the option to start a C++ project</title>
    <para>You have not installed the CDT. See <xref linkend="installingcdt"/>.</para>
  </section>
  <section xml:id="permission_denied">
    <title>Error 1, open output file blabla.exe: Permission denied</title>
    <para>Every time I start Eclipse on my laptop, I can only compile and run
    a program once. After that it asks if I want to run it with errors every
    time. The compiler says this:</para>
    <programlisting>Building target: Project01Test.exe
Invoking: GCC C++ Linker
g++ -oProject01Test.exe ./test.o
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot         
open output file Project01Test.exe: Permission denied
collect2: ld returned 1 exit status
make: *** [Project01Test.exe] Error 1
make: Target `all' not remade because of errors.
Build complete for project Project01Test
</programlisting>
    <para>Answer: Your program may still be running. Try stopping it by using
    the small red square on the console window (the one for your program).
    Another way is switching to the "Debug" perspective, selecting your
    running program, and stopping it there (also the small red square).</para>
  </section>
  <section xml:id="no_debugger">
    <title>The debugger doesn't work (on windows, with MinGW)</title>
    <para>Unfortunately gdb is not included in the current (4.1.1 or 5.0.2)
    version of MinGW. See <xref linkend="gdb"/>.</para>
  </section>
  <section xml:id="argument_minus_k">
    <title>Incorrect command line argument: -k'</title>
    <para>Make sure you are using the make programs provided by MinGW. If your
    output in the console shows something like:</para>
    <programlisting>make -k clean all
MAKE Version 5.2  Copyright (c) 1987, 2000 Borland
Incorrect command line argument: -k</programlisting>
    <para>Then you have make installed from a previous installation of Borland
    C++. You have several choices:</para>
    <itemizedlist>
      <listitem>
        <para>Adjust your PATH environment variable to have the MinGW / MSYS
        installation come before Borlands tools. Please be warned that this
        may break your Borland tools!</para>
      </listitem>
      <listitem>
        <para>Remove the path to the Borland tools from your PATH. This will
        definitely break your Borland tools.</para>
      </listitem>
      <listitem>
        <para>Download "mingw32-make". This is an option when installing
        MinGW. Make sure you set your make setting to be "mingw32-make". If
        you still get an error, try setting it for the build settings in your
        project. In this case you may even skip the installation of MSYS, but
        you will get limited functionality.</para>
      </listitem>
    </itemizedlist>
  </section>
  <section xml:id="a_jre_must_be_available">
    <title>A Java Runtime Envrionment (JRE) or Java Development Kit (JDK) must
    be available...</title>
    <para>There are several possible reasons for that:</para>
    <itemizedlist>
      <listitem>
        <para>You have not installed Java. Please see <xref linkend="java"/>.</para>
      </listitem>
      <listitem>
        <para>Your "path" environment is messed up (Windows). Please see <xref linkend="envwin"/>. Make sure <command>C:\windows\system32</command>
        is in your path (should be there by default).</para>
      </listitem>
      <listitem>
        <para><link xlink:href="http://www.java.com">java.com</link> has a
        button called <computeroutput>verify
        installation</computeroutput>.</para>
      </listitem>
    </itemizedlist>
  </section>
  <section xml:id="no_binaries">
    <title>I have no binaries</title>
    <para>If you have no binaries folder, then one of several things may have
    happened:</para>
    <itemizedlist>
      <listitem>
        <para>You are not looking at the C/C++ Project view. Make sure you are
        in the C++ perspective and "C/C++ Projects" is active. An example of
        this situation is shown in <xref linkend="navigator"/>: Click on
        "C/C++ Projects" to fix.</para>
      </listitem>
      <listitem>
        <para>Your program didn't compile. Check the output of the "Console"
        Window. It is either an error in your program or a configuration
        error. For configuration errors, check the other problems.</para>
      </listitem>
      <listitem>
        <para>AutoBuild is turned off. Turn it on as described in <xref linkend="buildauto"/>.</para>
      </listitem>
      <listitem>
        <para>If you do have a binaries folder, then make sure you run you
        program by right-clicking (on the mac: hold down ctrl and click) on
        the binary, and then selecting Run / Run as C/C++ Application. Just
        hitting the run button will only work after you have done that at
        least once!</para>
      </listitem>
    </itemizedlist>
    <figure xml:id="navigator">
      <title>The Navigator view instead of the C/C++ Projects view</title>
      <screenshot>
        <mediaobject>
          <imageobject>
            <imagedata fileref="navigator.png"/>
          </imageobject>
        </mediaobject>
      </screenshot>
    </figure>
  </section>
  <section xml:id="jarfile_startup">
    <title>Unable to access jarfile startup.jar</title>
    <para>This problem happens on Windows when you moved Eclipse out of its
    directory instead of creating a shortcut. Please move it back into the
    Eclipse directory, then drag'n'drop it using the right mouse button, where
    you can select "Create Shurtcut"</para>
  </section>
  <section xml:id="cygwin_on_windows">
    <title>Problems when CYGWIN is installed on Windows</title>
    <para>I personally do not recommend the installation of cygwin, but rather
    the installation of MinGW and MSYS as described in <xref linkend="wincompiler"/>. However, the following problems have been
    reported by users:</para>
    <section xml:id="cygwin_dll">
      <title>Binaries require cygwin.dll</title>
      <para>Eclipse prefers to use cygwin if it is installed, and will do
      everything to manipulate the path to include cygwin if it is installed.
      Binaries will therefore by default be linked against the cygwin
      libraries. Possible workarounds:</para>
      <itemizedlist>
        <listitem>
          <para>add <computeroutput>-mno-cygwin</computeroutput> to your
          compiler settings</para>
        </listitem>
        <listitem>
          <para>Overwrite the path variable in eclipse: In the Project
          Properties: C/C++ Build -&gt; Environment -&gt; User Variables -&gt;
          New. Select PATH, remove the cygwin directory and select Replace as
          Operation.</para>
        </listitem>
      </itemizedlist>
    </section>
  </section>
  <section xml:id="working_directory">
    <title>Launch failed Reason: Unable to set working directory</title>
    <para>Your workspace or your eclipse installation may use a path with
    includes spaces, such as <computeroutput>C:\Documents and
    Settings</computeroutput>. Eclipse sometimes fails in this case. Try
    creating your workspace in a different directory.</para>
  </section>
  <section xml:id="other_problems">
    <title>Problems not covered here</title>
    <para>If you read the online version of this document, check out <xref linkend="introduction"/>. You problem may be covered in a newer version
    of this document.</para>
    <para>If you are still having trouble, you may try and send me an email.
    Please be aware that I may not respond to every email, as I am doing this
    support mainly as a hobby. Make sure your email includes the following.
    Please send the complete output!</para>
    <itemizedlist>
      <listitem>
        <para>The contents of your PATH environment variable (in Windows:
        <command>echo %PATH%</command>. In Linux / Mac OS X: <command>echo
        $PATH)</command>.</para>
      </listitem>
      <listitem>
        <para>Version of GCC you're using (<command>gcc
        --version</command>)</para>
      </listitem>
      <listitem>
        <para>Version of Make you're using (<command>make --version</command>
        or <command>gmake --version</command>)</para>
      </listitem>
      <listitem>
        <para>Version of Eclipse you're using</para>
      </listitem>
      <listitem>
        <para>Version of the CDT you're using</para>
      </listitem>
      <listitem>
        <para>The complete output of your "Console" window (at the bottom of
        eclipse) when your error occurs.</para>
      </listitem>
      <listitem>
        <para>The steps you did so before the problem occurred.</para>
      </listitem>
    </itemizedlist>
  </section>
</section>
