Make utility complains about "undefined reference" when I tried to make TPC-E test

866 Views Asked by At

The problem is compounded by the fact that I am far from programming.

I need to use the TPC-E test. I downloaded the source codes from their website.

There is a miserable and almost meaningless ReadMe. Here are its contents:

To use the Makefile you must first set the following environment variables 
to match your system and compiler requirements:

CXX: path and name of compiler
    ex: export CXX=/opt/SUNWspro/bin/CC  (C++ compiler on Solaris)
CCFLAGS: compiler options
    ex: export CCFLAGS="-g -O"  
        -g enable debug
        -O optimize code
LDFLAGS: linker/loader options
    ex: export LDFLAGS="-g"
LIBS: extra libraries to link in
    ex: export LIBS="-lpthread"

According to the instructions there, I created the necessary environment variables (I just removed the -g switch from the CCFLAGS variable). After that, I ran the make utility and got more than five thousand lines of errors. Apparently he lacks some libraries. On this my knowledge ends.

Here are some error messages received:

...

/usr/bin/ld: DateTime.o: in function `TPCE::CDateTime::Validate(int, int, int, int, int, int, int)': DateTime.cpp:(.text+0xee): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'
/usr/bin/ld: DateTime.cpp:(.text+0xfd): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
/usr/bin/ld: DateTime.cpp:(.text+0x107): undefined reference to `__cxa_allocate_exception'
/usr/bin/ld: DateTime.cpp:(.text+0x117): undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
/usr/bin/ld: DateTime.cpp:(.text+0x122): undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: DateTime.cpp:(.text+0x135): undefined reference to `operator delete(void*)'

...

/usr/bin/ld: error.cpp:(.text._ZN4TPCE10CSystemErrD0Ev[_ZN4TPCE10CSystemErrD5Ev]+0x24): undefined reference to `std::exception::~exception()'
/usr/bin/ld: error.cpp:(.text._ZN4TPCE10CSystemErrD0Ev[_ZN4TPCE10CSystemErrD5Ev]+0x31): undefined reference to `operator delete(void*, unsigned long)'
/usr/bin/ld: error.o: in function `TPCE::CSystemErr::~CSystemErr()':error.cpp:(.text._ZN4TPCE10CSystemErrD2Ev[_ZN4TPCE10CSystemErrD5Ev]+0x1c): undefined reference to `operator delete(void*)'

...

/usr/bin/ld: locking.cpp:(.text+0x1fb): undefined reference to `operator delete(void*)'
/usr/bin/ld: locking.cpp:(.text+0x202): undefined reference to `std::runtime_error::~runtime_error()'
/usr/bin/ld: locking.cpp:(.text+0x209): undefined reference to `typeinfo for std::runtime_error'
/usr/bin/ld: locking.cpp:(.text+0x211): undefined reference to `__cxa_throw'
/usr/bin/ld: locking.o: in function `TPCE::CMutex::lock()':locking.cpp:(.text+0x246): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Openmode)'

...

A search on the internet made me think of installing the libboost-all-dev package, but that didn't help. In the end, I gave up - I’m completely incomprehensible to the terminology and I don’t have time to study C ++ programming.

Operating System - Debian 10

Questions: which libraries need to be installed and is there anyone who used these tests, how to adapt them to PostgreSQL?

Full error log (892 230 bytes)

1

There are 1 best solutions below

0
On

I replaced

export CXX=/usr/bin/gcc

with

export CXX=/usr/bin/c++