All the libs and dependencies are correct installed on my linux box. i can compile my test program with libwnck-3.0 in a simple make file:
LDFLAGS = -lX11 `pkg-config --cflags --libs gtkmm-3.0 libwnck-3.0 `
CPPFLAGS = -g -Wall -Wno-reorder -std=c++11 `pkg-config --cflags gtkmm-3.0 libwnck-3.0`
OUTPUTDIR = bin
# Macro that uses the backslash to extend to multiple lines.
OBJS = \
main.o \
$(NULL)
all:$(OBJS)
$(CC) $(CPPFLAGS) -o$(OUTPUTDIR)/$(APPNAME) $(OBJS) $(LDFLAGS)
main.o:main.cpp
$(CC) -I$(INCLUDE) $(CPPFLAGS) -c main.cpp
...
the point is that to compile and link libwnck-3.0 i need to use:
pkg-config --cflags -libs libwnck-3.0
the g++ compiler will compile and link my program without problems. But how i can do this with autotools Makefile.am?
here the main.cpp sample:
#define WNCK_I_KNOW_THIS_IS_UNSTABLE 1
#include <libwnck/libwnck.h>
#include <gtkmm.h>
int main(int argc, char *argv[])
{
gdk_init (&argc, &argv);
//check if libwnck works
WnckScreen* wnckscreen = wnck_screen_get_default();
Gtk::Main kit(argc, argv);
Gtk::Window mainWindow;
Gtk::Button button("Click here");
mainWindow.set_title("GTKmm Demo");
mainWindow.set_border_width(4);
mainWindow.set_default_size(200, 50);
mainWindow.add(button);
button.show();
Gtk::Main::run(mainWindow);
return 0;
}
and here the Automake test Makefile.am:
bin_PROGRAMS = testprogram
testprogram_SOURCES = main.cpp
# that is for gtkmm
testprogram_CPPFLAGS = $(GTKMM_CFLAGS)
# the include for libwnck-3.0
testprogram_CPPFLAGS += -I/usr/include/libwnck-3.0
testprogram_CPPFLAGS = $(GTKMM_CFLAGS)
# Linker flags
testprogram_LDFLAGS =`pkg-config --cflags --libs gtkmm-3.0 libwnck-3.0`
after run autogen.sh, ./configure and make, it compiles gtkmm but i get a link error: undefine reference to wnck_screen_get_default() The linker can't find the libwnck-3.0 package. ;o(
I have trying many variations and spend days on google without success.
Thank you in advance for any help!