Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup a makefile in eclipse (C++)?

I have a project in Eclipse and I want to use my own makefile. I went to

project -> properties -> C/C++ Build

and unchecked "Generate Makfiles Automatically". I have a makefile named Makefile in the project base dir which just contains:

all: 
    g++ *.cpp -o Simulator.exe

When I try to build, I get the following error:

Build of configuration MinGW GCC for project CacheOptimization

(Cannot run program "make": Launching failed)

How can I fix this and make eclipse compile my code?

like image 271
Amir Rachum Avatar asked Nov 21 '10 18:11

Amir Rachum


2 Answers

You probably don't have MINGW configured properly, and Eclipse can't run "make". This might be useful: Setting up a compiler

like image 107
cristis Avatar answered Nov 08 '22 07:11

cristis


Either:

  • install MSys package which includes make along with other useful tools (recommended),
  • or look into your project's settings under C/C++ Build and change the build command from make to mingw32-make, which is distributed as a part of MinGW.
like image 33
Kos Avatar answered Nov 08 '22 06:11

Kos