[SOLVED] gtkmm & eclipse on ubuntu [message #873552] |
Fri, 18 May 2012 14:13 |
Martin H Messages: 2 Registered: May 2012 |
Junior Member |
|
|
I'm trying to compile the simple.cc example:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
Glib::RefPtr<Gtk::Application> app =
Gtk::Application::create(argc, argv,
"org.gtkmm.examples.base");
// Gtk::ApplicationWindow window; It seems that this line is incorrect in the example.
Gtk::Window window;
return app->run(window);
}
Taken from the gtkmm documentation.
CONSOLE
I've tried to compile this program from terminal/console with this command line instruction:
g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`
And it generate the output. Then I run it and it works as it should.
ECLIPSE
Then I try to do the same but on eclipse, I create a new C++ Proyect, then I add the simple.cc file.
After that I change the build options adding the following instructions:
`pkg-config --cflags gtkmm-3.0` on GCC C++ Compiler > Miscelaneous
`pkg-config --libs gtkmm-3.0` on GCC C++ Linker > Miscelaneous
When I try to compilet it have to following message:
**** Build of configuration Debug for project gtk ****
make all
Building file: ../simple.cc
Invoking: GCC C++ Compiler
g++ -I/usr/include/gtkmm-3.0 -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config --cflags gtkmm-3.0` -MMD -MP -MF"simple.d" -MT"simple.d" -o "simple.o" "../simple.cc"
Finished building: ../simple.cc
Building target: gtk
Invoking: GCC C++ Linker
g++ `pkg-config --libs gtkmm-3.0 ` -o "gtk" ./simple.o
./simple.o: In function `main':
/home/hgmart/workspace/gtk/Debug/../simple.cc:7: undefined reference to `Glib::ustring::ustring(char const*)'
/home/hgmart/workspace/gtk/Debug/../simple.cc:7: undefined reference to `Gtk::Application::create(int&, char**&, Glib::ustring const&, Gio::ApplicationFlags)'
/home/hgmart/workspace/gtk/Debug/../simple.cc:7: undefined reference to `Glib::ustring::~ustring()'
/home/hgmart/workspace/gtk/Debug/../simple.cc:9: undefined reference to `Gtk::Window::Window(Gtk::WindowType)'
/home/hgmart/workspace/gtk/Debug/../simple.cc:11: undefined reference to `Gtk::Application::run(Gtk::Window&)'
/home/hgmart/workspace/gtk/Debug/../simple.cc:11: undefined reference to `Gtk::Window::~Window()'
/home/hgmart/workspace/gtk/Debug/../simple.cc:7: undefined reference to `Glib::ustring::~ustring()'
/home/hgmart/workspace/gtk/Debug/../simple.cc:11: undefined reference to `Gtk::Window::~Window()'
./simple.o: In function `__static_initialization_and_destruction_0':
/usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:45: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:46: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:47: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:48: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:49: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:50: undefined reference to `Glib::ustring::~ustring()'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference to `Glib::ustring::ustring(char const*)'
/usr/include/gtkmm-3.0/gtkmm/papersize.h:51: undefined reference to `Glib::ustring::~ustring()'
collect2: ld devolvió el estado de salida 1
make: *** [gtk] Error 1
**** Build Finished ****
I've search a lot of forums messages but I haven't reached the solution. It seems like a linker problem but I can't solve it.
SOLUTION
For and old post from this forum:
Quote:Edit C++ linker/Command line pattern in the way to move "${FLAGS}" at the end and KEEP SPACES as they make sense.
[Updated on: Fri, 18 May 2012 16:07] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03598 seconds