본문 바로가기

Tools/Eclipse

이클립스에서 발생할 수 있는 몇가지 오류들을 해결하자.

이거 찾는데 고생했다.
출처 : Max Berger

다음은 이클립스에서 발생할 수 있는 공통된 오류들에 대한 해결 방법이다.

Common Problems

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:

How to fix most of the errors on Windows

Make sure you have done the following things:

  • Installed the CDT

  • Installed (not just downloaded) MinGW

  • Installed (not just downloaded) MSYS

  • Set up your path environment variable

Especially made sure you did the last step. You will need to restart eclipse. (This solves about 99% of all support mails I've got so far).

Build error (Exec error:Launching failed), CreateProcess: make -k all error=2,

You have just tried the build the hello world program, and you get this error message instead of an executable. This means that make 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 make. If that doesn't work, try gmake.

If gmake worked, see the section called “Configuring the CDT”.

If neither worked, make sure you install make (See the section called “Setting up a compiler”) and set your path (See the section called “Environment Variables” in the case of Windows).

To check your path (on windows), open up cmd and type in echo %path%. 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.

If you are on Windows, and you have installed MinGW, but not MSYS, you may have an executable called mingw-make. In this case you have to go to the section called “Configuring the CDT” 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 MinGW FAQ for more information.

/bin/sh: line 1: g++: command not found, Error launching external scanner info generator

This error message means that g++ is either not installed or not in your path. Check your path settings as described in the section called “Build error (Exec error:Launching failed), CreateProcess: make -k all error=2,”, but this time try the commands: gcc --version and g++ --version. 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 the section called “Setting up a compiler”.

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!

No output or only sometimes output

If you are on windows and use Eclipse 3.1 with CDT 3.0.0 there is a bug. see the section called “Configuring the CDT”.

Error launching 'cygpath' command

If you followed these instructions you have installed MSYS instead of cygwin. You may safely ignore this error message.

I do not have the option to start a C++ project

You have not installed the CDT. See the section called “Installing the CDT”.

Error 1, open output file blabla.exe: Permission denied

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:

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

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).

The debugger doesn't work (on windows, with MinGW)

Unfortunately gdb is not included in the current (4.1.1 or 5.0.2) version of MinGW. See the section called “GDB (optional!)”.

Incorrect command line argument: -k'

Make sure you are using the make programs provided by mingw. If your output in the console shows something like:

make -k clean all
MAKE Version 5.2  Copyright (c) 1987, 2000 Borland
Incorrect command line argument: -k

Then you have make installed from a previous installation of Borland C++. You have several choices:

  • 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!

  • Remove the path to the Borland tools from your PATH. This will definitely break your Borland tools.

  • 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.

A Java Runtime Envrionment (JRE) or Java Development Kit (JDK) must be available...

There are several possible reasons for that:

I have no binaries

If you have no binaries folder, then two things may have happened

  • You are not looking at the C/C++ Project view. Make sure you're in the C++ perspective and the browser says "C/C++ Projects".

  • 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.

  • 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!

Unable to access jarfile startup.jar

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"

Problems not covered here

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 (unless you're in my class). Make sure your email includes the following. Please send the complete output!

  • The contents of your PATH environment variable (in Windows: echo %PATH%. In Linux / Mac OS X: echo $PATH).

  • Version of GCC you're using (gcc --version)

  • Version of Make you're using (make --version or gmake --version)

  • Version of Eclipse you're using

  • Version of the CDT you're using

  • The complete output of your "Console" window (at the bottom of eclipse) when your error occurs.

  • The steps you did so before the problem occured.


'Tools > Eclipse' 카테고리의 다른 글

Eclipse CDT 5.0의 추가기능  (0) 2008.10.05
MinGW 연동하기  (0) 2008.10.05
SVN 설치 및 연동  (0) 2008.10.05
나만의 이클립스 환경설정  (0) 2008.09.10
eclipse에서 static library를 만들고 링크하여 컴파일 하기  (1) 2008.09.04