Issue
I develop library and trying run tests. When I run example building I got the undefined reference errors (in example one of that errors):
/opt/nt/lib/libntproto2db.so: undefined reference to ntproto::variant_t::TYPE::UINT8'
But, if I install same version with same commit from repository, which contains package built on the someone else machine, i have not received this error.
nm
tool recognizes symbol as undefined, if library built on my machine:
$ nm -C -u /opt/nt/lib/libntproto2db.so | grep UINT8
U ntproto::variant_t::TYPE::UINT8
That is, if I build this library on another machine, then these symbols do not become undefined. Why?
I tried:
- Move
std::unordered_map
globalinline const
variable, that contains values of this type from.h
to.cc
file, that helped, but this is bad solution. - Disable optimization
-O0
- Check
$LIBRARY_PATH
, it's clear as a must be. - View
ld
commandline during both builds (make VERBOSE=1
), it is the same.
Solution
This is a distro problem, on docker it builds succesfully. Probably, one of the packages on my distro have wrong version.
Answered By - OlegUP Answer Checked By - Gilberto Lyons (WPSolving Admin)