0

I'm supposed to install some fitting software from a source; the software is called XMBF (http://www.stefanmeinel.com/software/XMBF/). Supplied with the source code is a makefile, but no configure file. The manual says that I will most likely need to edit the "INCPATH" variable in the Makefile in order depending on the machine I'm using; I've tried this, but am still getting errors, such as this one:

/usr/include/glibmm-2.4/glibmm/ustring.h:24:26: fatal error: 
glibmmconfig.h: No such file or directory
compilation terminated.
Makefile:279: recipe for target 'main.o' failed
make: *** [main.o] Error 1

which indicate that a .cpp isn't able to locate a headerfile. Does this mean that I have to go to every .cpp file and edit the header file paths? Or is there an easier way of doing this? I'm decently new at this stuff, so I'd much appreciate any references that could help me learn how installations from sources work. Or is this installing from a "binary?" I'm unsure of the difference.

Thanks!

-Jacob

  • Also: I have installed the libraries mentioned in the manual (libxml++2.6, C++ Boost libraries, and GSL) – Jacob Hempel May 22 '17 at 20:35
0

Probably the easiest thing is to let pkg-config do the work for you:

INCPATH      := $(shell pkg-config --cflags libxml++-2.6 glibmm-2.4)

You can do a similar thing for the libraries:

LIBS         := $(shell pkg-config --libs libxml++-2.6 glibmm-2.4 sigc++-2.0 gsl)

You will likely find that you also need to modify the actual link rule for the executable target, so that the libraries are to the right of the object files:

$(LINK) -o $(TARGET) $(OBJECTS) $(LFLAGS) $(LIBS)

That was enough to get it to build on my 16.10 box, with default gcc-6 - on Ubuntu 16.04 with the default gcc-5.x you may need to instruct the compiler to use C++11 features e.g. make "CXXFLAGS=-std=gnu++11" .

  • Thank you so much for your answer! I didn't know about pkg-config. It began building until I got to a bunch of errors "undefined reference to glib::ustring::ustring()" and of the sort. I didn't quite understand what you mean by "Modify the actual link rule for the executable target" what do you mean? I've recently learned a little about makefiles, so I apologize if this is a trivial question. – Jacob Hempel May 22 '17 at 23:49
  • I just mean find the line of the Makefile that looks like $(LINK) $(LFLAGS) $(LIBS) -o $(TARGET) $(OBJECTS) and change it like $(LINK) -o $(TARGET) $(OBJECTS) $(LFLAGS) $(LIBS) - to understand why, see Why does the order of '-l' option in gcc matter? – steeldriver May 22 '17 at 23:52

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.