How to compile and run c++ program from Kate editor using build tool?

I'm trying to compile and run a c++ program from Kate editor with the following build command.

konsole -e g++ -std=c++14 -Wall -c %f -o %n.o && chmod +x %n.o && ./%n.o

But it gives me the error "Exec format error". How to resolve this?

2

1 Answer

Lets say we have hello.cpp as our example c++ file. you can run through kate by pressing "F4" and writing the below commands.

g++ hello.cpp -o hello

./hello

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like