undefined reference to

Freed, Melanie Melanie.Freed at nyumc.org
Mon Feb 2 15:14:45 EST 2015


Hi.  I just installed openslide for the first time and am having some trouble getting it running in C++.  It seemed to install with no problems (on opensuse 13.1) and I just wrote a simple program to test it:


extern "C" {
  #include <openslide.h>
}
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <glib.h>
using namespace std;
int main (int argc, char * argv[])
{

  cout << "Version: " << openslide_get_version() << endl;

  return 0;
}


But when I run this I get the following compiler error:

g++ -Wall -I/usr/local/include/openslide -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -L/usr/lib -lm -lglib-2.0 -o AccessSlides AccessSlides.cc
/tmp/cc7Nmv18.o: In function `main':
AccessSlides.cc:(.text+0x11): undefined reference to `openslide_get_version'
collect2: error: ld returned 1 exit status

Does anyone know what might be causing this?  It seems like it's not finding the openslide functions at all even though I am including the openslide.h file...

Thanks!
Melanie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20150202/dddd5912/attachment.html 


More information about the openslide-users mailing list