Makefile in C++ - Geany

Asked

Viewed 112 times

0

Good afternoon, I’m new to programming in C++ using Geany. And I’m having a hard time when it comes to creating an interface between a class and main, that is, creating a class, for example message. h and message.cpp to access the message class’s own methods in main.cpp.

I have seen tutorials that explain how to create a Makefile file, however I get the error that no targets were created.

The Makefile I have is as follows:

output: main.o Language.o
    g++ main.o Language.o -o output

main.o: main.cpp
    g++ -c main.cpp


Language.o: Language.cpp Language.h
    g++ -c Language.cpp

clean:
    rm *.o output

If anyone has tips on how to "connect" classes and main are welcome.

  • make output should generate the output. If you want Compile only with make should create a target called all and put the output dependency.

  • @Viniciussouza already tried with make and did not give

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.