4

I don't understand one thing related with compiling the project from source.

How should I react when third party library is missing? What is the best approach with solving this kind of problem?

For example, I've cloned some code from github. The documentation says, that only thing which I should do is just run makefile. But during compilation I got:

libmy/include/somefile.h:16:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>

What should I do? I can start googling what is GL/gl.h and I will find information about package which should I install. But I don't believe that I have to googling for every missing header. It can't be a good solution.

I can use something like apt-file search and maybe I will find library which I should install. But still, I have to check every missing file in this way.

I suppose that problem is in the project. But I don't know how it should be fixed. Is the makefile should check is every thing is installed?

I read about pkg-config which look like something which can help with my problem. Should I use pkg-config to checking missing library?

What if pkg-config is missing, or user don't want install it?

Is there any better solution to solve this kind of problem?

1 Answer 1

2

Many packages contain special configure script that intent is to check whatever dependencies are installed on host machine. Others go through other mechanisms, which usually mentioned in README or INSTALL files inside a source package. Few can go and be compiled as standalone programs and they do not try to detect dependencies or they have no any.

If you pick up code from GitHub, then you should be ready for incomplete code that ends up not compiling like that. Then, if you clearly can't name what that file is from which dependency (and code you're downloaded has no documentation), you can only google it. Also, many header file names are remembered as your Unix experience grows :-)

Reasonable packages have scripts (or other mechanisms) to check for dependencies and/or documentation which says what dependencies you will need, incomplete or poor packages do not have that at all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .