Search code examples
linkercross-compilingopenwrt

How to link OpenWRT package with libstdcpp


I have a helloworld package and I can successfully build it with openwrt buildroot for ramips device. In Makefile I have one special include (ulibc) and one special dependency (DEPENDS:=+libc). Package builds and works on device. Now I need to include gSoap generated code in my helloworld package, but then I have link error:

undefined reference to `std::ios_base::Init::Init()'

What can I do in this case? The next step - adding openssl support and WS Security, could it work on OpenWRT device?


Solution

  • I solved my problem:

    1. Changed compiler in Makefile of my package sources from $(CC) to $(CXX) + $(CFLAGS) to $(CXXFLAGS)

    2. Included uClibc++.mk before package.mk

    3. Add only one dependency: DEPENDS:=+uclibcxx

    After this LNK error was fixed. Thanks to @amine.ahd!