Missing c lib support for Cheerp

Asked by Paul

Hi
  I keep running into this problem:

In file included from /test.h:9:
In file included from /Applications/cheerp/bin/../include/c++/v1/functional:496:
/Applications/cheerp/bin/../include/c++/v1/memory:1820:10: error: no matching
      function for call to 'free'
        {free(__p);}
         ^~~~
/Applications/cheerp/bin/../include/c++/v1/memory:1495:14: note: in
      instantiation of member function 'std::allocator<const
      apl::StyledText::Span>::deallocate' requested here
        {__a.deallocate(__p, __n);}
             ^
/Applications/cheerp/bin/../include/c++/v1/vector:472:25: note: in instantiation
      of member function 'std::allocator_traits<std::allocator<const
      apl::StyledText::Span> >::deallocate' requested here
        __alloc_traits::deallocate(__alloc(), __begin_, capacity());
                        ^
/Applications/cheerp/bin/../include/c++/v1/vector:477:29: note: in instantiation
      of member function 'std::__vector_base<const apl::StyledText::Span,
      std::allocator<const apl::StyledText::Span> >::~__vector_base' requested
      here
class _LIBCPP_TYPE_VIS_ONLY vector
                            ^
/Applications/cheerp/bin/../include/stdlib.h:90:22: note: candidate function not
      viable: no known conversion from 'pointer' (aka 'const
      apl::StyledText::Span *') to 'void *' for 1st argument; take the address
      of the argument with &
_VOID _EXFUN_NOTHROW(free,(_PTR));
                       ^
/Applications/cheerp/bin/../include/_ansi.h:64:37: note: expanded from macro
      '_EXFUN_NOTHROW'
#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW
                                        ^
4 errors generated.

test.h is trying to include the following:

#include <cassert>
#include <functional>
#include <memory>
#include <vector>

Here is my cmake command :
cmake -DCMAKE_TOOLCHAIN_FILE=/Applications/cheerp/share/cmake/Modules/CheerpToolchain.cmake -DBUILD_TESTS=ON -DCMAKE_SYSTEM_NAME=cheerp -frtti ..

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Cheerp Edit question
Assignee:
No assignee Edit question
Solved by:
Paul
Solved:
Last query:
Last reply:
Revision history for this message
Yuri Iozzelli (yuri91) said :
#1

Hi!

I cannot reproduce your problem. Can you provide us with a test case that shows the issue?

Thanks

Revision history for this message
Paul (lynxpaul) said :
#2

I'm trying to recreate a simple version of the issue i'm facing without having to dive into a huge code base. I'm not having much luck to recreate this as well on a simple hello world.

I'll keep trying to replicate this issue so i can give a concrete example. I'll let you guys know once i get one

Thanks

Revision history for this message
Paul (lynxpaul) said :
#3

was able to resolve this. Its because i'm using const variable within a shared pointer and it doens't like that