0

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 global inline 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.
OlegUP
  • 113
  • 4
  • Voting as dupe, since this seems to be your own lib that's incorrect here. Probably the solution for static data members applies. [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – fabian Oct 20 '22 at 19:07
  • This is a distro problem, on docker it builds succesfully. Probably, not one of the packages on my distro is wrong. – OlegUP Oct 25 '22 at 12:33

1 Answers1

-1

This is a distro problem, on docker it builds succesfully. Probably, one of the packages on my distro have wrong version.

OlegUP
  • 113
  • 4