Adapting the Makefile for our project with GTK

Adapting the Makefile for our project with GTK

by Mathias Alejandro Vogel Hüni -
Number of replies: 2

I cannot find a way such that the project becomes executable with just an added empty window. Neither by adding the mentioned Geany build commands (This gives me "undefined reference" errors, where there weren't any before), nor by adjusting the makefile so that it looks like the one for the HelloWorld example, with added different parameter for compiling each .o files. I think the problem is, that in these example programs, there aren't as many files linked together as in our project and I might miss some parameters.

Is there an example of how the makefile should look like when there are more than just one or two source/header files?


In reply to Mathias Alejandro Vogel Hüni

Re: Adapting the Makefile for our project with GTK

by Ronan Boulic -

The demo project Makefile is the same as the one of provided examples in série5.

The only difference is that the  list of object files (.o) is longer in the definition of the variable OFILES.

It might be important to provide this list of .o files with first the high-level modules followed by low-level module.

See for example the Makefile of helloword or drawarea : main.o is first and the lower level .o files comes after.

In reply to Mathias Alejandro Vogel Hüni

Re: Adapting the Makefile for our project with GTK

by Théo Stanislaw Gieruc -

This is my Makefile to compile the project with GTKmm.

Fill the 6th line with the names of all your .cc files (like in the first Makefile)

There is no more "make depend", you can directly use "make".

Use "make clean" to clean the .o files and the executable.

I added a "make debug" where "-D NDEBUG" is set in the CXXFLAGS for fast debugging purposes (like in the page 12 of the pdf "Préprocesseur" on topic 3). If you don't need just don't use it. 


I hope it works for you.