You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the documentation exactly but I cannot compile any of the examples after installing the current dev branch:
./autogen.sh
./configure
make -j2
sudo make install
[...]
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
[...]
I also added /usr/local/lib to a new file /etc/ld.so.conf.d/hdtcpp.conf and executed sudo ldconfig.
$ g++ -I/usr/local/include -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib search.cpp
/usr/bin/ld: /tmp/ccy8i6RF.o: in function `main':
search.cpp:(.text+0x20): undefined reference to `hdt::HDTManager::mapHDT(char const*, hdt::ProgressListener*)'
collect2: error: ld returned 1 exit status
The code of search.cpp is taken from https://www.rdfhdt.org/manual-of-the-c-hdt-library/:
#include<iostream>
#include<HDTManager.hpp>usingnamespacestd;usingnamespacehdt;intmain(int argc, char *argv[]) {
// Load HDT file (Use mapIndexedHDT if you plan to use ?p?, ?po or ??o queries.
HDT *hdt = HDTManager::mapHDT("data/test.hdt");
// Enumerate all triples matching a pattern ("" means any)
IteratorTripleString *it = hdt->search("http://example.org/uri3","","");
while(it->hasNext()){
TripleString *triple = it->next();
cout << triple->getSubject() <<
", " << triple->getPredicate() <<
", " << triple->getObject() << endl;
}
delete it; // Remember to delete iterator to avoid memory leaks!delete hdt; // Remember to delete instance when no longer needed!
}
I am very inexperienced with C++ so this may be something basic that is not written in the docs that experienced C++ programmers know already.
In case this is not a bug, I would be very glad if you could explain the problem in terms that a beginner C++ programmer can understand.
The HDT libraries seem to exist in /usr/local/lib:
I followed the documentation exactly but I cannot compile any of the examples after installing the current dev branch:
I also added
/usr/local/lib
to a new file/etc/ld.so.conf.d/hdtcpp.conf
and executedsudo ldconfig
.The code of search.cpp is taken from
https://www.rdfhdt.org/manual-of-the-c-hdt-library/
:I am very inexperienced with C++ so this may be something basic that is not written in the docs that experienced C++ programmers know already.
In case this is not a bug, I would be very glad if you could explain the problem in terms that a beginner C++ programmer can understand.
The HDT libraries seem to exist in
/usr/local/lib
:verbose
The text was updated successfully, but these errors were encountered: