I am having trouble creating the make file of the gtkmm file. I implemented a simple solution, however, I get the following error:
g ++ -Wall -std = C ++ 11 pkg-config gtkmm-3.0 --cflags -c main.cpp
cc main.o pkg-config gtkmm-3.0 --libs -o main
/ usr / bin / ld: main.o: undefined reference to the symbol '__gxx_personality_v0 @@ CXXABI_1.3'
/ usr / lib / x86_64-linux-gnu / libstdC ++. so.6: characters with errors added: DSO is not on the command line
collect2: error: ld returned 1 exit status
: recipe for target "main" failed
make: *** [main] Error 1
Makefile:
# Compiler CXX = g++ CXXFLAGS = -Wall -std=c++11 `pkg-config gtkmm-3.0 --cflags` # gtkmm library flags LDLIBS = `pkg-config gtkmm-3.0 --libs` PROGRAM = main SRCS = $(wildcard *.cpp) OBJS = $(SRCS:.cpp=.o) DEPEND = .depend .PHONY: clean $(PROG): $(OBJS) $(CXX) $^ -o $@ $(LDLIBS) # Object file rules: .cpp.o: $(CXX) $(CXXFLAGS) -c $< # Dependencies .depend: rm -f ./.depend $(CXX) $(CXXFLAGS) -MM $(SRCS) > $(DEPEND) all: .depend $(PROGRAM) clean: rm -f $(OBJS) rm -f $(PROGRAM) rm -f $(DEPEND) -include $(DEPEND)
main.cpp:
#include <gtkmm/application.h> #include "MainWindow.hpp" int main(int argc, char *argv[]) { Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base"); MainWindow window; // Show windows and return when closed return app->run(window); }
MainWindow.hpp:
#ifndef GUI_MAIN_WINDOW_H #define GUI_MAIN_WINDOW_H #include <gtkmm.h> class MainWindow: public Gtk::Window { public: MainWindow(); virtual ~MainWindow(); protected: Gtk::Frame frame; }; #endif // GUI_MAIN_WINDOW_H
mainwindow.cpp:
#include "MainWindow.hpp" MainWindow::MainWindow() {
What am I doing wrong?
c ++ makefile gtkmm
wolx
source share