OpenWrt Forum Archive

Topic: Problem with uclibc++

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I try to compile a package and I am using the SDK.
libstdc++ works fine, but I try to switch to uClibc++ to save 2 or 3 MB smile
I used the Makefiles from
http://wiki.openwrt.org/BuildingPackagesHowTo
i.e. "Sample Makefile for C++ shipped with configure script, and uClibc++ linkables"

configure and make works well, but linking fails with:
libQoS.a(QoSServer.o): In function `QoSServer::handleClientSocket(int, void*)':
QoSServer.cpp:(.text+0x2eb4): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

There are many more lines, all regarding stdlib stuff.

Any ideas?

Christian Dickmann

uclibc++ may not have everything that is required by your program.

I thought of that, but it seems, that no STL stuff works. Judging from the uclibc website,
everything I use should be supported.
See the error I pasted in the previous post? It referres to a standard string, isn't it?

I am using the libstdc++.so.6 library on my router, but at boot time, it is in .tgz file format, and a script uncompresses it in /tmp, which I believe is in ram.

The compressed file uses 163ko of flash memory and uncompresses in about 2 seconds to 720ko.
I have a symbolic link in /usr/lib that links to the library in /tmp.

Perhaps that would work for you too?

Stanislas

stanelie wrote:

I am using the libstdc++.so.6 library on my router, but at boot time, it is in .tgz file format, and a script uncompresses it in /tmp, which I believe is in ram.

The compressed file uses 163ko of flash memory and uncompresses in about 2 seconds to 720ko.
I have a symbolic link in /usr/lib that links to the library in /tmp.

Perhaps that would work for you too?

Stanislas

Thank you for this idea. But still not perfect.
I would really like to get uClibc++ running

Finally, I found the problem.
My configure script set the CXX_FLAGS manually, thus overriding the instructions from the OpenWrt-Makefile.
In addition I found a small glitch in the Makefile for uclibc++ provided in the OpenWrt-Wiki. It said $(CC) instead
of $(CP) ...

If I want to contribute to http://wiki.openwrt.org/BuildingPackagesHowTo, which is a Immutable Page, how do
I do that?

Christian Dickmann

The discussion might have continued from here.