(06.06.2024 15:08)SWAT писал(а): -r seems just ignore this error on link test of module.
Try add to module Makefile:
I already set the variable in makefile
GCC_LIB=-lgcc
But I went back to the beginning, I removed the "-r" and I got all those errors, here comes the _atexit one
It doesn't let me use std::string and so on, I can define it in the class but when I use it in the constructor it shows me all these errors:
Inside the class:
std::string image_file;
Inside the constructor
image_file = "ok";
If I remove the line from image_file = "ok"; build correctly.
Video:
https://youtu.be/Ujw685Koubc
Код:
/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc -g -ml -m4-single-only -O2 -g -Wl,-Ttext=0x00000000 -e _start -nostartfiles -nodefaultlibs -o dbg-app_games.klf module.o ItemMenuFake.o exports.o -L/usr/local/dc/kos/kos/lib/dreamcast -L/usr/local/dc/kos/kos/addons/lib/dreamcast -L/usr/local/dc/kos/kos/../kos-ports/lib -L/usr/local/dc/kos/kos/ds/sdk/lib -L/usr/local/dc/kos/kos/ds/sdk/lib -Wl,--start-group -lstdc++ -ltsunami -lds -lkallisti_exports -lgcc -Wl,--end-group
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(eh_globals.o): in function `_GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE':
(.text.startup._GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE+0x34): undefined reference to `__dso_handle'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: (.text.startup._GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE+0x3c): undefined reference to `__cxa_atexit'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_getentropy(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_getentropyEPv+0x24): undefined reference to `getentropy'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::(anonymous namespace)::__libc_arc4random(void*)':
(.text._ZNSt12_GLOBAL__N_117__libc_arc4randomEPv+0x8): undefined reference to `arc4random'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: /opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/lib/libstdc++.a(random.o): in function `std::random_device::_M_init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text._ZNSt13random_device7_M_initERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xa4): undefined reference to `getentropy'
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: dbg-app_games.klf: hidden symbol `___dso_handle' isn't defined
/opt/toolchains/dc/sh-elf/lib/gcc/sh-elf/13.2.0/../../../../sh-elf/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [../../../sdk/Makefile.loadable:116: app_games.klf] Error 1
make[1]: Leaving directory '/usr/local/dc/kos/kos/ds/applications/games/modules'
make: *** [/usr/local/dc/kos/kos/Makefile.rules:57: _dir_modules] Error 2