Hi everyone,
I hope this is the correct board for my question. After I update my SDK with the latest version and set GCC 11.2.0 as default I get weird errors when compiling my project.
Sometimes (not always) it throws errors for not finding
If these errors are not happening then it complains about near endless errors regarding things like:
(.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.0+0x58): undefined reference to __gthread_active_p' ld: Dwarf Error: found dwarf version '0', this reader only handles version 2, 3 and 4 information
but this also does not happen everytime.
I added -gstabs to my CFLAGS as well as -fno-threadsafe-statics - but no change.
It is really acting randomly and incomprehensible. Any idea what might be wrong here? Is the 11.2.0 version within the SDK instable?
Thank you in advance for your help.
I guess this is happening on the linker, right? Maybe you need to add
-lpthread
when you link your application.
Thank you. Will try it. Is this supported in AOS4 and its SDK?
Did not work. I get the message:
ld: cannot find -lpthreads
Before latest SDK I had GCC 2.4.3 (IIRC - the one of the old SDK) and that one compiled everything fine.
Any idea what I can still try? Do I have to state newlib or clib2 in particular or so?
I meanwhile tested all versions of GCC which are in the latest SDK. The only one which does not throw such errors is 6.4.0 - but that one throws different errors:
src/WizardGroundsC.cc:200: undefined reference to `std::__throw_bad_array_new_length()' o/WindowC.o: In function `std::_Rb_tree_iterator<std::pair<int const, GadgetC*> >&& std::forward<std::_Rb_tree_iterator<std::pair<int const, GadgetC*> > >(std::remove_reference<std::_Rb_tree_iterator<std::pair<int const, GadgetC*> > >::type&)': /DH1/Prog/SDK/gcc/include/c++/11.2.0/bits/stl_pair.h:(.text._ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiP7GadgetCEEE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiP7GadgetCEEE8allocateEjPKv]+0x68): undefined reference to `std::__throw_bad_array_new_length()' o/PlayerC.o: In function `std::vector<BuildingC*, std::allocator<BuildingC*> >::end()': /DH1/Prog/SDK/gcc/include/c++/11.2.0/bits/alloc_traits.h:(.text._ZN9__gnu_cxx13new_allocatorIP9BuildingCE8allocateEjPKv[_ZN9__gnu_cxx13new_allocatorIP9BuildingCE8allocateEjPKv]+0x64): undefined reference to `std::__throw_bad_array_new_length()' o/PlayerManagerC.o: In function `PlayerManagerC::~PlayerManagerC()': src/PlayerManagerC.cc:9: undefined reference to `std::__throw_bad_array_new_length()' o/MenusC.o: In function `MenusC::~MenusC()': src/MenusC.cc:10: undefined reference to `std::__throw_bad_array_new_length()' o/MenusC.o:src/MenusC.cc:67: more undefined references to `std::__throw_bad_array_new_length()' follow make: *** [bin/WizardGrounds] Error 1
Maybe I stick with that version and try to fix things. But as said version 2.4.3 did compile everything fine.
No clue what I still can try to get one of the later GCC versions working.
"-lpthread" no S at the end
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P