How to build a static boost library? - c++

More specifically static boost::iostreams with zlib (aka libz) support.
The problem is, that when I try to link static library it throws unresolved symbols. At the same time when I try to link dynamic library everything works...
I've been searching for answer for several days and can't find it yet.
The command I use to build shared library: b2 -a -q -j8 address-model=32 toolset=gcc --with-iostreams link=shared runtime-link=shared -sZLIB_INCLUDE="path" -sZLIB_LIBPATH="path" -sBZIP2_INCLUDE="path" -sBZIP2_LIBPATH="path"
The command I use to build static library: b2 -a -q -j8 address-model=32 toolset=gcc --with-iostreams link=static runtime-link=static -sZLIB_INCLUDE="path" -sZLIB_LIBPATH="path" -sBZIP2_INCLUDE="path" -sBZIP2_LIBPATH="path"
Example of the program:
#include <iostream>
#include <boost/iostreams/filter/gzip.hpp>
int main(int argc, char* argv[]) {
int a = boost::iostreams::zlib::default_compression;
std::cout << a << std::endl;
return 0;
}
The exception I get:
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x124): undefined reference to `crc32'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x181): undefined reference to `deflate'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x1a1): undefined reference to `inflate'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x1cc): undefined reference to `deflateReset'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x1e5): undefined reference to `inflateEnd'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x201): undefined reference to `inflateReset'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x214): undefined reference to `deflateEnd'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x3c9): undefined reference to `inflateInit2_'
D:\boost_1_72_0\stage\lib/libboost_iostreams-mgw63-mt-s-x32-1_72.a(zlib.o):zlib.cpp:(.text+0x469): undefined reference to `deflateInit2_'
collect2.exe: error: ld returned 1 exit status
makefile:15: recipe for target 'Source.exe' failed
mingw32-make: *** [Source.exe] Error 1
The terminal process terminated with exit code: 1
UPDATE:
Also in case the problem may be related to zlib or bz2:
I got bz2 lib here: http://gnuwin32.sourceforge.net/packages/bzip2.htm
and zlib here: http://gnuwin32.sourceforge.net/packages/zlib.htm
And I tried to build zlib myself with their win32 makefile. I got libz.a and tried to build with it as well, nothing's changed.

As you may know, to solve this problem on unix you just need to add -lz argument.
The same works for windows users. You just (more likely) don't have zlib.a/lib location in your PATH environment variable. So to solve the problem you shall add 2 arguments: -Lpath_to_zlib -lz. Such a simple solution and I've spent hours trying to fix it.

Related

g++ building c++ program with boost dependencies

I want to compile and run a simple c++ websocket application with g++ on windows.
Boost was installed like this:
./bootstrap.bat mingw
./b2.exe install --prefix=C:/boostLibs toolset=gcc
My c++ includes look like this:
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
#include <iostream>
This websocket sample was provided by https://github.com/zaphoyd/websocketpp
In order to build the project I issue this command:
g++ -Wno-deprecated -I ./cppServer/libs/ -I C:\boostLibs\include\boost-1_55 -L C:\boostLibs\lib -g ./cppServer/server.cpp -lboost_system
Which leeds me to this error message:
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lboost_system
collect2.exe: error: ld returned 1 exit status
If I try to build without -lboost_system, I get a very long exception, starting with:
C:/boostLibs/include/boost-1_55/boost/system/error_code.hpp:222: undefined reference to boost::system::generic_category()'
C:/boostLibs/include/boost-1_55/boost/system/error_code.hpp:223: undefined reference toboost::system::generic_category()'
C:/boostLibs/include/boost-1_55/boost/system/error_code.hpp:224: undefined reference to boost::system::system_category()'
C:\Users\JOHANN~1.HAS\AppData\Local\Temp\ccpKMWTH.o: In functionZN5boost6system10error_codeC1Ev':
C:/boostLibs/include/boost-1_55/boost/system/error_code.hpp:323: undefined reference to boost::system::system_category()'
C:\Users\JOHANN~1.HAS\AppData\Local\Temp\ccpKMWTH.o: In functionZN5boost6system4errc20make_error_conditionENS1_6errc_tE':
C:/boostLibs/include/boost-1_55/boost/system/error_code.hpp:488: undefined reference to boost::system::generic_category()'
C:\Users\JOHANN~1.HAS\AppData\Local\Temp\ccpKMWTH.o: In functionZN5boost16thread_exceptionC2EiPKc'
So what am I missing? I can't figure it out right now.
Link to boost_system as -lboost_system-mgw63-mt-1_55, because this is what those files are called. See boost library naming for more details.
When you build boost you may like to specify --layout=system to b2.exe so that your files do not have that -mgw63-mt-1_55 in the filename and then just use -lboost_system when linking against it.

Installing GTest and GMock

I have installed GTest and GMock on my Ubuntu 17.04 box. Broadly speaking installed as follows;
sudo apt-get install libgtest-dev
cmake CMakeLists.txt
make
I then sym linked the libraries creaetd in /usr/src in /usr/lib. (ie link in /usr/lib points to /usr/src)
I then did the same for GMock
sudo apt-get install -y google-mock
then cmake and make as above
Libraries sym linked as before.
I have created the following CMakeLists.txt
project(chapterFirstExample)
cmake_minimum_required(VERSION 2.6)
include_directories(/usr/include)
link_directories(/usr/lib)
add_definitions(-std=c++0x)
set(CMAKE_CXX_FLAGS "${CMAXE_CXX_FLAGS} -Wall")
set(sources
main.cpp
SoundexTest.cpp)
add_executable(tddTest ${sources})
target_link_libraries(tddTest pthread)
target_link_libraries(tddTest gmock)
target_link_libraries(tddTest gtest)
And have two source files
main.cpp
#include "gmock/gmock.h"
int main(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
}
SoundexTest.cpp
class Soundex
{
};
#include "gmock/gmock.h"
TEST(SoundexEncoding, RetainsSoleLetterOfOneLetterWord)
{
Soundex soundex;
}
(I am working through Jeff Langr's Modern C++ Programming with Test Driven Development book)
I run cmake on my CmakeLists.txt file, which runs without error. When I run make though I get this;
[ 33%] Linking CXX executable tddTest
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x24): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x39): undefined reference to `pthread_key_delete'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::~ThreadLocal()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x24): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x39): undefined reference to `pthread_key_delete'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x25): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x88): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE9CreateKeyEv]+0x27): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::CreateKey()':
gtest-all.cc:(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE9CreateKeyEv]+0x27): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gtest-all.cc.o): In function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::GetOrCreateValue() const':
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x25): undefined reference to `pthread_getspecific'
gtest-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEE16GetOrCreateValueEv]+0x88): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gmock-all.cc.o): In function `testing::internal::ThreadLocal<testing::Sequence*>::CreateKey()':
gmock-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_8SequenceEE9CreateKeyEv[_ZN7testing8internal11ThreadLocalIPNS_8SequenceEE9CreateKeyEv]+0x27): undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gmock-all.cc.o): In function `testing::internal::ThreadLocal<testing::Sequence*>::GetOrCreateValue() const':
gmock-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_8SequenceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_8SequenceEE16GetOrCreateValueEv]+0x25): undefined reference to `pthread_getspecific'
gmock-all.cc:(.text._ZNK7testing8internal11ThreadLocalIPNS_8SequenceEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalIPNS_8SequenceEE16GetOrCreateValueEv]+0x88): undefined reference to `pthread_setspecific'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libgmock.a(gmock-all.cc.o): In function `testing::internal::ThreadLocal<testing::Sequence*>::~ThreadLocal()':
gmock-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_8SequenceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_8SequenceEED5Ev]+0x24): undefined reference to `pthread_getspecific'
gmock-all.cc:(.text._ZN7testing8internal11ThreadLocalIPNS_8SequenceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_8SequenceEED5Ev]+0x39): undefined reference to `pthread_key_delete'
collect2: error: ld returned 1 exit status
CMakeFiles/tddTest.dir/build.make:120: recipe for target 'tddTest' failed
make[2]: *** [tddTest] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/tddTest.dir/all' failed
make[1]: *** [CMakeFiles/tddTest.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
I am new to cmake, and very rusty on make. This output though makes me feel thought that I have not built GTest or GMock correctly. Can anyone give some pointers please. (No pun intended)
Thanks
The order of libraries passed to the linker matters. When the linker sees a library file name, by default (*) it pulls in just the objects from that library which resolve one or more undefined symbols it knows are needed at that point.
So if a library A depends on a library B but you pass main.o -lB -lA to the linker, when it comes to -lB it will pull in some objects from B if they are needed by main.o, but then if A needs additional symbols from B, it will not go back and look for additional objects from B, so those needed symbols remain unresolved.
gmock depends on gtest, and gmock (and maybe gtest?) depend on pthread, so a better order for your libraries would be:
target_link_libraries(tddTest gtest)
target_link_libraries(tddTest gmock)
target_link_libraries(tddTest pthread)
(*) Some GNU ld linker options cause different behavior. In particular, --whole-archive -lsomething --no-whole-archive will force it to get ALL the contents from a library file, needed or not. --start-group -lA -lB -lC --end-group will cause it to repeatedly loop over a set of libraries until none of them can be used to resolve any more symbols for a whole loop. But most of the time, it's enough to just list the libraries you need so that the libraries that use other libraries come earlier in the list.

Boost "undefined reference" errors even with -lboost_thread

I'm getting some strange compiler/linker errors when trying to use boost::shared_mutex. I'm using boost v1.61 on a VM running 32-bit rhel 6.2.
Code that causes error:
hpp file:
#include <boost/thread/shared_mutex.hpp>
class SharedData
{
public:
SharedData();
~SharedData();
void packMessage(std::shared_ptr<Message> s);
private:
// mutex that allows multiple read, single write protection
boost::shared_mutex m_sharedMutex;
};
cpp file:
void SharedData::packMessage(std::shared_ptr<Message> s)
{
// get shared read access
boost::shared_lock<boost::shared_mutex> lock(m_sharedMutex); // <- this line causes the errors
// read stuff here
}
make output:
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::detail::interruption_checker::interruption_checker(pthread_mutex_t*, pthread_cond_t*)':
/usr/local/include/boost/thread/pthread/thread_data.hpp:195: undefined reference to `boost::detail::get_current_thread_data()'
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::condition_variable::wait(boost::unique_lock<boost::mutex>&)':
/usr/local/include/boost/thread/pthread/condition_variable.hpp:81: undefined reference to `boost::this_thread::interruption_point()'
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::shared_mutex::lock_shared()':
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:186: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:193: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:193: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/tester] Error 1
Everywhere I've searched has said that these errors mean I need to link the boost_thread library, which I've done in my cmake file (boost_system is included for other code in this same project):
target_link_libraries(${BINARY_NAME} boost_thread boost_system)
But the errors persist.
Originally I was using the boost 1.41 libraries that were already installed on my machine. When I hit these errors I ran yum remove boost-devel and then manually installed boost 1.61 to see if that would correct the errors. Is there something extra I needed to add to the ./bootstrap.sh or ./b2 install commands? I can see libboost_thread.a in /usr/local/lib, so I assumed that meant the thread library was built correctly.
Any thoughts on what is causing these errors? Thanks!
Edit:
Cmake's log didn't have anything useful I could see, but make VERBOSE=1 gives the following output:
cd /home/craig/dev/myProject/build/test && /usr/bin/cmake -E cmake_link_script CMakeFiles/tester.dir/link.txt --verbose=1
/opt/rh/devtoolset-2/root/usr/bin/c++ -std=c++11 -ggdb -Wall -Werror -fprofile-arcs -ftest-coverage -fPIC -O0 -pedantic -Wl,--export-dynamic CMakeFiles/tester.dir/utilities/googletest/googletest/src/gtest-all.cc.o CMakeFiles/tester.dir/tester.cpp.o CMakeFiles/tester.dir/SharedData/testSharedData.cpp.o CMakeFiles/tester.dir/Common/testFifo.cpp.o CMakeFiles/tester.dir/Common/testCsu.cpp.o CMakeFiles/tester.dir/Messages/testMessage.cpp.o CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o CMakeFiles/tester.dir/__/src/Common/Fifo.cpp.o CMakeFiles/tester.dir/__/src/Common/Csu.cpp.o -o ../bin/tester -rdynamic -lboost_system -lpthread
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::detail::interruption_checker::interruption_checker(pthread_mutex_t*, pthread_cond_t*)':
/usr/local/include/boost/thread/pthread/thread_data.hpp:195: undefined reference to `boost::detail::get_current_thread_data()'
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::condition_variable::wait(boost::unique_lock<boost::mutex>&)':
/usr/local/include/boost/thread/pthread/condition_variable.hpp:81: undefined reference to `boost::this_thread::interruption_point()'
CMakeFiles/tester.dir/__/src/SharedData/SharedData.cpp.o: In function `boost::shared_mutex::lock_shared()':
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:186: undefined reference to `boost::this_thread::disable_interruption::disable_interruption()'
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:193: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
/usr/local/include/boost/thread/pthread/shared_mutex.hpp:193: undefined reference to `boost::this_thread::disable_interruption::~disable_interruption()'
Turns out my question is just like everyone else's.
#jww suggested I show the actual compile and link command invocation, not CMake's output, which I've added to my question. As you can see, the command is linking boost_system and pthread, but not boost_thread.
Digging into my project I realized that I had added boost_thread to my release build, but not into my unit test build, which is what I was trying to compile. Adding boost_thread to the unit test's CMakeLists.txt removed the error immediately.

Trouble using boost, cannot open shared object file

So I'm trying to compile and run a simple boost timer program
#include <iostream>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
int main() {
using namespace boost::asio;
io_service io;
deadline_timer t(io, boost::posix_time::seconds(5));
t.wait();
std::cout << "Hello World!" << std::endl;
return 0;
}
The first thing I tried when compiling this program was to do
g++ -I /home/vagrant/boost_1_60_0 main.cpp
which gave me an error of
/tmp/cc8Ytqko.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0xfc): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x108): undefined reference to `boost::system::generic_category()'
main.cpp:(.text+0x114): undefined reference to `boost::system::system_category()'
/tmp/cc8Ytqko.o: In function `boost::system::error_code::error_code()':
main.cpp:(.text._ZN5boost6system10error_codeC2Ev[_ZN5boost6system10error_codeC5Ev]+0x17): undefined reference to `boost::system::system_category()'
/tmp/cc8Ytqko.o: In function `boost::asio::error::get_system_category()':
main.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv[_ZN5boost4asio5error19get_system_categoryEv]+0x5): undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
So then I did some research and it seems I needed to build the boost_system binaries so I went to directory boost was located in and ran
./bootstrap.sh
./b2 --with-system
Then I compiled again
g++ -I /home/vagrant/boost_1_60_0 main.cpp -L/home/vagrant/boost_1_60_0/stage/lib/ -lboost_system
and this didn't give me any error but when I ran the executable
vagrant#vagrant-ubuntu-trusty-64:/vagrant$ ./a.out
./a.out: error while loading shared libraries: libboost_system.so.1.60.0: cannot open shared object file: No such file or directory
Don't really know what I need to do here
liibboost_system.so.1.60.0 cannot be found in the list of directories searched by the dynamic linker. The non-default shared-object location is not stored in the binary by default. The environment variable LD_LIBRARY_PATH can be used to add directories that will be searched before the standard locations:
LD_LIBRARY_PATH=/home/vagrant/boost_1_60_0/stage/lib/ ./a.out
This will only work for the current bash environment, and there are also ways to store the path in the executable so that the environment variable is not needed.

Error in linking external libraries

I downloaded TripleBit's source code from http://grid.hust.edu.cn/triplebit/TripleBit.tar.gz.
It required me to install two libraries:
i) boost-1.39.0.tar.gz
ii) raptor-1.4.21.tar.gz
I installed them using :
sudo apt-get install libboost-dev
sudo apt-get install libraptor-dev
However, after I entered into TripleBit's directory and ran "make". I go the following errors:
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:38: undefined reference to `raptor_init'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:39: undefined reference to `raptor_new_parser'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:40: undefined reference to `raptor_set_statement_handler'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:42: undefined reference to `raptor_uri_filename_to_uri_string'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:43: undefined reference to `raptor_new_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:44: undefined reference to `raptor_uri_copy'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:45: undefined reference to `raptor_parse_file'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:47: undefined reference to `raptor_free_parser'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:48: undefined reference to `raptor_free_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:49: undefined reference to `raptor_free_uri'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:50: undefined reference to `raptor_free_memory'
/home/TripleBit/BuildTripleBitFromRDF/BuildTripleBit.cpp:52: undefined reference to `raptor_finish'
collect2: ld returned 1 exit status
make: *** [bin/lrelease/buildTripleBitFromRDF] Error 1
The library files which reside within /usr/local/lib are:
libboost_filesystem.so, libraptor.a, libraptor.la, libraptor.so, libraptor.so.1
and libraptor.so.1.2.0
Also the files which reside within /usr/lib are:
libraptor.a, libraptor.la, libraptor.so, libraptor.so.1, libraptor.so.1.2.0,
libraptor2.so.0, libraptor2.so.0.0.0, librasqal.so.3, librasqal.so.3.0.0, librdf.so.0,
librdf.so.0.0.0, librest-0.7.so.0, librest-0.7.so.0.0.0.
Can someone please help me in finding out the error.
I ran it on ubuntu 12.04
Look into TripleBit Makefile. You are missing -lraptor linker option. This entry should be returned by raptor-config --libs.
You can also run nm tool against libraptor.a file and check if it wasn't compiled with RAPTOR_DISABLE_V1 option.
Look into TripleBit Makefile, you can remove the "BuildTripleBitFromRDF" in line 82(modules := ..), so that you can escape the errors, but the "BuildTripleBitFromRDF" will not build into the executables. So when the dataset you download is a RDF dataset, You can use raptor to convert RDF dataset into N3 dataset, and then use the buildTripleBitFromN3 tool to go on.
The probable problem is the wrong installing in raptor.