Friday 15 January 2010

c++ - Modify makefile created using autoconf -



c++ - Modify makefile created using autoconf -

i using autoconf create makefile app using gtkmm-3.0. configure script running , makefile generated. makefile puts object files after libraries as:

g++ -g -o2 -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0 -o base of operations base-base.o

which giving next error:

/usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference `glib::ustring::~ustring()' /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference `glib::ustring::ustring(char const*)' /usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference `glib::ustring::~ustring()' base-base.o: in function `main': /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `glib::ustring::ustring(char const*)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `gtk::application::create(int&, char**&, glib::ustring const&, gio::applicationflags)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:7: undefined reference `glib::ustring::~ustring()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::window(gtk::windowtype)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:10: undefined reference `gtk::window::set_default_size(int, int)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:12: undefined reference `gtk::application::run(gtk::window&)' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::~window()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:13: undefined reference `glib::ustring::~ustring()' /home/shashwat001/documents/ubuntuapps/gtkmmapps/firstapp/src/base.cpp:9: undefined reference `gtk::window::~window()'

but when manually run above statement object file before libraries:

g++ -g -o2 -o base of operations base-base.o -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lpangomm-1.4 -lgtk-3 -lglibmm-2.4 -lcairomm-1.0 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lsigc-2.0 -lgobject-2.0 -lglib-2.0

then no error happens. problem order of libraries , object file. modify in autoconf script force order alter in makefile?

what modify in autoconf script force order alter in makefile?

if utilize autoconf (without automake), need modify files ".in" extension, makefile.in, , rerun "./configure".

if utilize automake, instead of makefile.in have edit makefile.am. , after run autoreconf && ./configure

c++ makefile configure autoconf gtkmm

No comments:

Post a Comment