help

Jan Harkes jaharkes at cs.cmu.edu
Wed Jan 5 14:46:41 EST 2011


On 01/05/2011 11:51 AM, Kriti Chakdar wrote:
> I'm using openslide
> I have never worked with external libraries
> and I'm having some problems
> 
> I have installed all the libraries( openslide, libjpeg, libtiff, openjpeg,
> glib, cairo) from /usr/lib
> and have all the .h files
> 
> now when I'm trying to run the test program by
> cc -o test test.c

Are you trying to 'run' or 'compile' the test program?

What OS/distribution are you using, did you install the openslide
library from pre-built packages or are you trying to build/install it
from source.

When I grab the openslide source and run "./configure && make", the test
program is automatically built, it is marked to not be installed though.

> it is not able to find the include ed .h files
> because they are not in the same location

What is the exact error, which .h files are not found?
What directory are you running the compile from, you aren't specifying
any library to link against, or which paths to search for include files
and/or libraries.

The test application should just build when you are in the
openslide-3.2.3 directory and run 'make' (after a successful configure).

> config.h is in openlide-3.2.3
> 
> callgrind, openslide these are in openslide-3.2.3/src
> 
> cairo.h and etc are in their respective folders

The minimal set of options that may work when you are in
openslide-3.2.3/test would be something like,
  cc -I.. -I../src -o test test.c -L../src/.libs -lopenslide

However, this will build a version of test that assumes that the
openslide library is not installed in /usr/lib.

If you want to build and link against a version of openslide installed
in /usr/lib then the following may work,

  cc $(pkg-config --cflags openslide) test.c \
     $(pkg-config --libs openslide) -o test

I am not sure why test is depending on config.h, it looks like it may
not actually need that header. The callgrind.h header should really be
provided by 'valgrind', if valgrind installs it outside of the default
include path you have to also include $(pkg-config --cflags valgrind).

Jan


More information about the openslide-users mailing list