How to install C++ plugin to Eclipse?

后端 未结 4 2239
青春惊慌失措
青春惊慌失措 2020-12-02 19:29

I apologize beforehand for this noobish Q, but Im starting to learn C++, and have only used Java.

I have also searched here and elsewhere for a solution to this and

相关标签:
4条回答
  • 2020-12-02 20:03

    g++ is installed as part of MinGW. If you are getting an error in Eclipse that it cannot find g++ then your path is most likely incorrect. From a command prompt you should be able to run:

    g++ --version

    and it should display the version of g++ in the MinGW/bin directory.

    Eclipse uses this path to locate the include files and the compiler. Once you get the path correct restart Eclipse and the problems listed in your question should be resolved.

    0 讨论(0)
  • 2020-12-02 20:10

    Nowadays (Eclipse Juno and newer), it is much simpler. You just need to:

    • Install MinGW (and including C++ compiler)
    • Add the paths "C:\minGW\bin" and "C:\minGW\msys\1.0\bin" (or wherever you installed MinGW to) to your Windows "Path" variable
    • Install Eclipse. If Eclise already is installed, restart it. it will recognize that MinGW is now available.
    • Create a New project: "C++ Project"
    • For every Project type in the following dialog, you should now be able to select the "MinGW GCC" toolchain
    • Happy coding
    0 讨论(0)
  • 2020-12-02 20:12

    See here: http://www.youtube.com/watch?v=QhvXCg2CY4Q

    0 讨论(0)
  • 2020-12-02 20:14

    Firstly, in the following examples all drive-letters should be replaced with the relevant ones on your system. Not all of these steps are really necessary, but it works (and the more the merrier).

    We start with the slightly simpler release config - we want to make it compile.

    Go to Project -- Properties

    Look if the include directories are correct and in place.

    enter image description here

    Go to Project -- Properties -- Run/Debug Settings -- NEW -- Main Tab

    Set to Release and Browse to the Release folder of the project. If the exe file is not set type in its name.

    Properties 1

    Switch to Common Tab. Check Allocate Console and Launch in Background. Don't Run yet.

    Properties 2

    Go to Project -- Properties -- C/C++ Build -- Discovery Options

    Tools -- GCC C++ Compiler

    "Browse" to the mingw bin folder and select the g++.exe or copy mingw32-g++.exe to g++.exe

    Note: The image points to mingw32-g++.exe please use g++.exe

    Property 3

    Right click on the project and look -- Build Configurations -- Set Active -- Release is checked.

    Right click on the project -- Run As -- Run Configurations.

    Under C/C++ Application select, the one which refers to the release version. Then click Run

    If this works, I will show you how to set the Debug Properties. (more complicated)

    0 讨论(0)
提交回复
热议问题