c++makefilelinker-errorsqmakesaxon-c

Undefined reference error when link to Saxon library in C++


I download the latest SaxonC-HE for Linux library from https://www.saxonica.com/download/c.xml

Then from the above website, I follow copy libsaxon-hec-12.4.1 to /usr/local/lib And start writing code. When compile the code in C++, I got error:

Undefined reference to 'SaxonProcessor::newXQueryProcessor' etc

In my qmake file, I add LIBS += -lsaxon-hec-12.4.1

Pseudo code:

#include SaxonProcessor.h
SaxonProcess *processor = new SaxonProcessor(false);
XQueryProcessor *query = processor->newXQueryProcessor();
query->setQueryContent(content);
query->setParameters(parameter, XdmValue);
const char *result = query->runQueryToString();

I am wondering if I need to compile the saxonc library myself and generate lib files so I can link to. But there is no make file from the downloaded SaxonC folder


Solution

  • Fixed the error by adding saxon source files into my project.