Score:0

Undefined reference to libraries while building

br flag

I am trying to install tgs2apng in Ubuntu on WSL. As instructed I installed the 3 libraries- rlottie, libpng and apngasm. However When I run make I get undefined references to rlottie and apngasm

Here's the output of make

g++ -Wl,--start-group -lrlottie -lapngasm -lboost_filesystem -lboost_regex -Wl,--end-group -Wl,-rpath-link=/usr/local/lib    tgs2apng.cpp   -o tgs2apng
tgs2apng.cpp: In function ‘bool tgs2apng::render(const string&, const string&, size_t, size_t)’:
tgs2apng.cpp:30:38: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
   30 |  std::fprintf(stderr, "Frame count: %d\n", frames);
      |                                     ~^     ~~~~~~
      |                                      |     |
      |                                      int   size_t {aka long unsigned int}
      |                                     %ld
/usr/bin/ld: /tmp/ccWPPbxE.o: in function `tgs2apng::render(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long, unsigned long)':
tgs2apng.cpp:(.text+0xf3): undefined reference to `rlottie::Animation::loadFromData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x175): undefined reference to `rlottie::Animation::totalFrame() const'
/usr/bin/ld: tgs2apng.cpp:(.text+0x193): undefined reference to `rlottie::Animation::frameRate() const'
/usr/bin/ld: tgs2apng.cpp:(.text+0x25d): undefined reference to `apngasm::APNGAsm::APNGAsm()'
/usr/bin/ld: tgs2apng.cpp:(.text+0x315): undefined reference to `rlottie::Surface::Surface(unsigned int*, unsigned long, unsigned long, unsigned long)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x36e): undefined reference to `rlottie::Animation::renderSync(unsigned long, rlottie::Surface, bool)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x4ad): undefined reference to `apngasm::APNGFrame::APNGFrame(apngasm::rgba*, unsigned int, unsigned int, unsigned int, unsigned int)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x4c6): undefined reference to `apngasm::APNGAsm::addFrame(apngasm::APNGFrame const&)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x4ec): undefined reference to `apngasm::APNGAsm::assemble(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: tgs2apng.cpp:(.text+0x506): undefined reference to `apngasm::APNGAsm::~APNGAsm()'
/usr/bin/ld: /tmp/ccWPPbxE.o: in function `std::default_delete<rlottie::Animation>::operator()(rlottie::Animation*) const':
tgs2apng.cpp:(.text._ZNKSt14default_deleteIN7rlottie9AnimationEEclEPS1_[_ZNKSt14default_deleteIN7rlottie9AnimationEEclEPS1_]+0x22): undefined reference to `rlottie::Animation::~Animation()'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: tgs2apng] Error 1

ldconfig -p | grep rlottie returns-

  librlottie.so.0 (libc6,x86-64) => /lib/librlottie.so.0
  librlottie.so (libc6,x86-64) => /lib/librlottie.so
  librlottie-image-loader.so (libc6,x86-64) => /lib/librlottie-image-loader.so

and ldconfig -p | grep apngasm returns-

  libapngasm.so (libc6,x86-64) => /usr/local/lib/libapngasm.so

I think that means the libraries are installed, can anyone point out the cause of this error?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.