0

I have installed Codelite and I have g++ installed on my machine:

enter image description here

I've also used the following settings when creating a new codelite project

enter image description here

And I 've created a simple project

#include <iostream>

int main(int argc, char **argv)
{
    std::cout << "Hello World" << std::endl;
    return 0;
}

But when clicking Build > Build Project, I get the following Build report

/bin/sh -c 'make -j 8 -e -f  Makefile'
----------Building project:[ Hello_World - Release ]----------
make[1]: Entering directory             '/home/sepideh/Documents/new_workspace/Hello_World'
clang++  -c  "/home/sepideh/Documents/new_workspace/Hello_World/main.cpp" -O2 -Wall -DNDEBUG  -o ./Release/main.cpp.o -I. -I.
/bin/sh: 1: clang++: not found
Hello_World.mk:95: recipe for target 'Release/main.cpp.o' failed
make[1]: *** [Release/main.cpp.o] Error 127
make[1]: Leaving directory '/home/sepideh/Documents/new_workspace/Hello_World'
Makefile:4: recipe for target 'All' failed
make: *** [All] Error 2
====0 errors, 0 warnings====

And if I choose Build > Run, I'll get the following output report.

Current working directory: /home/sepideh/Documents/new_workspace/Hello_World/Release
Running program: /usr/lib/codelite/codelite_xterm './Hello_World ' '/bin/sh -f /usr/lib/codelite/codelite_exec ./Hello_World'
Program exited with return code: 0  

enter image description here

I also had a similar problem on windows and the .exe file was not created.

Sepideh Abadpour
  • 301
  • 1
  • 4
  • 13

1 Answers1

2

Install clang in 18.04 with the following command:

sudo apt install clang-6.0

Codelite

When you start a new console project select the Simple executable (clang++) Template. For Compiler (2 screens after the Select the project template screen) select clang(tags/RELEASE_600/final) or whatever clang version you have in the dropdown menu.

enter image description here

The results of Build and Run Project:

Hello World
Press ENTER to continue...

Terminal

The command clang is for C, and the command clang++ is for C++. The correct command for compiling hello.cpp with clang is:

clang++ hello.cpp

which results in an executable file named a.out

or

clang++ -o hello hello.cpp   

which results in an executable file named hello.

karel
  • 114,770