Prathamesh Konkar
Prathamesh Konkar

Reputation: 9

is it possible to cross compile (with uclibc toolchain) a program which uses a shared library that causes 'undefined reference to printf@GLIBC_2.0'

I'm cross compiling a SDK for an embedded board using pre-built mips-linux-uclibc- toolchain. While compiling a set of sources that makes use of libom_api.so library causes an error "undefined reference to `printf@GLIBC_2.0'" and 10 other symbols like [email protected]. In Makefile they have passed -lom_api along with some other app specific libraries. Is it because libom_api.so is compiled using Glibc compiler? how can I resolve this issue? SDK doesn't have sources of libom_api.so. What I tried: I built a Glibc cross-toolchain with buildroot and passed $(LDGLIBC) to compiler after -lom_api in Makefile (LDGLIBC = -L$(ROOTDIR)/glibc-toolchain/GLIB), still causing error.

Upvotes: 0

Views: 705

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

is it possible to cross compile (with uclibc toolchain) a program which uses a shared library that causes 'undefined reference to printf@GLIBC_2.0'

No.

Is it because libom_api.so is compiled using Glibc compiler? how can I resolve this issue?

Yes. More precisely, libom_api.so has been compiled using GLIBC headers and linked against GLIBC implementation of the standard C library.

Your only choices are:

  • obtain a different version of libom_api.so, one built against uClibc, or
  • eliminate dependency on libom_api, or
  • use GLIBC for your entire project

Upvotes: 1

Related Questions