2

I could not find the answer to my problem in the other similar questions.

After installing Eclipse IDE for C/C++ Developers on my mac, when I want to run a simple Hello program in C++, I get the following error in the console:

Error: build command 'cmake' not foundFailure running cmake:

Any ideas will be appreciated.

developer
  • 283
  • 2
  • 8
  • Is it Eclipse CDT? Eclipse does not usually come with a C++ compiler, so it is looking for CMake to find a compiler and build your project. It doesn't find one on your system. – Koenigsberg Oct 24 '19 at 10:06
  • Or to put it simpler - you cannot install Eclipse, write a *Hello World* program and then just compile it. Iirc there is some more setting up to do first. – Koenigsberg Oct 24 '19 at 10:10
  • It is Elcipse 2019.9. I chose the the Hello program in a list of ready sample codes the application shows on startup. – developer Oct 24 '19 at 10:13
  • Eclipse IDE for C/C++ Developers. I edited the post. thanks. – developer Oct 24 '19 at 10:14
  • Yes, it is part of the CDT package. In any case - you don't have a C++ compiler. See this for further info: https://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.html – Koenigsberg Oct 24 '19 at 10:17

2 Answers2

3

That answer does the job perfectly:

  • Under Eclipse Preferences -> C/C++ -> Build -> Environment click the select button then check the PATH row and click ok.

Figure 1

  • Double-click on the PATH row and modify the value by adding a :then the location of your make executable (for me /Applications/CMake.app/Contents/bin/cmake so I added /Applications/CMake.app/Contents/bin)

Figure 2

Tested on macOS Monterey 12.6 and Eclipse IDE for C/C++ Developers 2022-09 (4.25.0)

Sisyffe
  • 162
  • 11
0

I followed the answer provided here and it worked.

  • Make sure to replace the PATH string by your echo $PATH output in the Info.plist, as mentioned here. Also, execute the command suggested here.

I am on macOS Catalina 10.15 and Eclipse IDE for C/C++ Developers Version: 2019-09 R (4.13.0).

Ps: I also tried to set the environment variables on Eclipse, as suggested here, but it did not work.

rvimieiro
  • 1,043
  • 1
  • 10
  • 17