Any ideas?
main.cxx:
Code: Select all
#include <gtk/gtk.h>
//-------------------------------------------------------------------------------------------------
int main
(
int argc,
char** argv
)
{
gtk_init( &argc, &argv );
GtkBuilder* builder = gtk_builder_new_from_file( "src/TaskMaster.glade" );
if ( builder == nullptr )
g_error("Error creating libglade interface");
return 0;
}
Code: Select all
GTKHDRs = $(shell pkg-config --cflags glib-2.0 gtk+-3.0)
GTKLIBs = $(shell pkg-config --libs glib-2.0 gtk+-3.0)
CXX := g++
CXX_FLAGS := -Iinclude -Wall -W -std=c++17 -ggdb $(GTKHDRs)
LDFLAGS := $(GTKLIBs)
BIN := bin
SRC := src
EXECUTABLE := taskmaster
all: $(BIN)/$(EXECUTABLE)
run: clean all
./$(BIN)/$(EXECUTABLE)
$(BIN)/$(EXECUTABLE): $(SRC)/*.cxx
$(CXX) $(CXX_FLAGS) $(LDFLAGS) $^ -o $@
clean:
-rm -f $(BIN)/*
rebuild: clean all
Code: Select all
g++ -Iinclude -Wall -W -std=c++17 -ggdb -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 src/main.cxx -o bin/taskmaster
/usr/bin/ld: /tmp/ccHgbbwf.o: in function `main':
/home/niblacks/Documents/Projects/TaskMaster/src/main.cxx:11: undefined reference to `gtk_init'
/usr/bin/ld: /home/niblacks/Documents/Projects/TaskMaster/src/main.cxx:13: undefined reference to `gtk_builder_new_from_file'
/usr/bin/ld: /home/niblacks/Documents/Projects/TaskMaster/src/main.cxx:15: undefined reference to `g_log'
collect2: error: ld returned 1 exit status
make: *** [Makefile:19: bin/taskmaster] Error 1
The terminal process "/bin/bash '-c', 'make'" terminated with exit code: 2.