std::string error during the linking phase

440 views
Skip to first unread message

Angelo Mantellini

unread,
Apr 23, 2018, 1:57:00 PM4/23/18
to discuss-webrtc
Hi,
I'm developing, for testing, a modified version of webrtc that uses an external library.
the problem is that a c++ class method with a std::string parameter is not recognize.
the error is the following
undefined symbol: hicnet::core::Prefix::Prefix(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)
Do you have ideas about this issue?
Thank you very much

Angelo

angelo mantellini

unread,
Apr 23, 2018, 2:13:28 PM4/23/18
to discuss-webrtc
I forgot: I'm using ubuntu 16.04.
Thank you very much

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/e6aced18-9a67-4de3-a006-b7ec30f3046e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sukhbir Singh

unread,
Apr 23, 2018, 2:34:14 PM4/23/18
to discuss...@googlegroups.com
> I forgot: I'm using ubuntu 16.04.
> Thank you very much
>
> Il giorno lun 23 apr 2018 alle ore 19:56 Angelo Mantellini
> <amant...@gmail.com> ha scritto:
>>
>> Hi,
>> I'm developing, for testing, a modified version of webrtc that uses an
>> external library.
>> the problem is that a c++ class method with a std::string parameter is not
>> recognize.
>> the error is the following
>> undefined symbol:
>> hicnet::core::Prefix::Prefix(std::__1::basic_string<char,
>> std::__1::char_traits<char>, std::__1::allocator<char> >&)
>> Do you have ideas about this issue?
>> Thank you very much

I am not sure, but try setting "use_custom_libcxx=false" and
"use_custom_libcxx_for_host=false" in your GN_ARGS? I remember reading
this somewhere on the list though I can't find the post.

Sukhbir Singh

unread,
Apr 23, 2018, 2:35:37 PM4/23/18
to discuss...@googlegroups.com

Angelo Mantellini

unread,
Apr 23, 2018, 2:58:54 PM4/23/18
to discuss...@googlegroups.com
Hi,
With those parameters I have the following error:
../../components/assist_ranker/ranker_example_util.cc:33:23: error: no member named 'frexp' in namespace 'std'
f = std::abs(std::frexp(f, &exp));
~~~~~^
../../components/assist_ranker/ranker_example_util.cc:40:36: error: no member named 'ldexp' in namespace 'std'
const uint32_t mantissa = std::ldexp(f * 2.0f - 1.0f, kFloatMainDigits);

I'm compiling all chromium with libwebrtc. I hope this is not a problem.
Thank you very much
--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CADtjFvUYzk8q%3DzKjGmkiDamMYhdozE5hjmR824jOZGUG9xM8Pw%40mail.gmail.com.

Angelo Mantellini

unread,
Apr 23, 2018, 3:49:14 PM4/23/18
to discuss...@googlegroups.com
Thank you,
I have an error about assist_ranker. Std::frexp is not present.
Do you know if and how I can remove assist_ranker?

Thank you very much

On 4/23/18, 8:35 PM, "Sukhbir Singh" <discuss...@googlegroups.com on behalf of sukhb...@gmail.com> wrote:

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CADtjFvUYzk8q%3DzKjGmkiDamMYhdozE5hjmR824jOZGUG9xM8Pw%40mail.gmail.com.

Niels Moller

unread,
Apr 24, 2018, 4:47:04 AM4/24/18
to discuss...@googlegroups.com
It sounds like you are mixing object files compiled with different C++
library headers, e.g, one object file compiled with clang and its
libc++, and another object file compiled with gcc and its libstdc++.
That generally doesn't work.

As far as I understand, there's no such thing as a standard C++ ABI.
You have to arrange so that all your C++ source files are compiled
using the same compiler and C++ library. Sometimes you even have to
use the same version of the compiler; you have to consult the
documentation for the compiler you're using to see what ABI
compatibility it promises between versions.

Angelo Mantellini

unread,
Apr 24, 2018, 4:53:47 AM4/24/18
to discuss...@googlegroups.com
Hi,
I understand your position.
I tried to compile my library with g++ and clang++ installed in Ubuntu 16.04, but I had the same error.
I tried to compile my library using clang/clang++ included in chromium environment, but I had the same error.
I understand that the problem is about libstdc++ and libc++. Do you know if there is a way to compile my library using the chromium environment?
I tried to compile chromium with my host compiler using "use_custom_libcxx=false" and
"use_custom_libcxx_for_host=false", but I had errors about fuctions not found.

Thank you very much.
Angelo
--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAAO0x16e7XqvKfgb%2BrqqeSjmXEt3HycHic4-ohJQ3PjsnmS7jw%40mail.gmail.com.

Niels Moller

unread,
Apr 24, 2018, 5:36:18 AM4/24/18
to discuss...@googlegroups.com
On Tue, Apr 24, 2018 at 10:53 AM, Angelo Mantellini
<amant...@gmail.com> wrote:
> I tried to compile my library with g++ and clang++ installed in Ubuntu 16.04, but I had the same error.
> I tried to compile my library using clang/clang++ included in chromium environment, but I had the same error.
> I understand that the problem is about libstdc++ and libc++. Do you know if there is a way to compile my library using the chromium environment?
> I tried to compile chromium with my host compiler using "use_custom_libcxx=false" and
> "use_custom_libcxx_for_host=false", but I had errors about fuctions not found.

I'm afraid I'm not so familiar with the build machinery. It's possible
to build webrtc using gcc, with gn args

is_clang = false
treat_warnings_as_errors = false

(but support for building chromium with gcc is being phased out).

If you get errors on std::ldexp and std::frexp, maybe it's sufficient to add an

#include <cmath>

at the right place?

Angelo Mantellini

unread,
Apr 27, 2018, 5:40:33 AM4/27/18
to discuss...@googlegroups.com

Ok,
I solved correcting the code (including cmath) and putting -latomic as dependency library.
Thank you very much.
Angelo

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAAO0x15S3YamtKUzJxGL0%3DkHTdBuuBECyhFKKLVRjrqZe8AH%2Bg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages