String class in module & external lib: gdscript undefined symbol: Variantcv6StringEv

Godot Version

4.2.2-stable

Question

Hello ! First question here,
i need some external libraries for my godot project, and i am writing a bit of c++ code so i could use some methods of the api with gdscript in godot.
Reading the tutorial from the website i ended up configuring an external shared library to have faster compilation time.

->the SCsub file looks like this:
sources = [
“register_types.cpp”,
“mymodule.cpp”
]
module_env.Append(LIBPATH=[‘/home/pc/git/godot4.2.2-stable/modules/mymodule’])
module_env.Append(CCFLAGS=[‘-fPIC’,‘-fexceptions’]) // “-fexceptions” its a temporary measure
module_env[‘LIBS’] = [‘mylib’]
shared_lib = module_env.SharedLibrary(target='#bin/mymodule, source=sources)

->i used : scons target=editor platform=linuxbsd debug_symbols=yes module_mono_enabled=yes use_llvm=yes linker=lld custom_modules=“/home/pc/godot4.2.2-stable/modules/mymodule”
and it compile quickly

in the cpp file of the module a function call the api of the lib i want to use:
void Myclass::exec(int test, const String) {

i needed a « char const* » instead of a « const String », but i had a compilation error
so because i thought that i needed to use one of the types that gdscript can use in variant, i tried with a String from godot, it compiles, but when i use the function in the editor using the gdscript function, it throw an error that i do not know how to solve:
It looks like this:
/home/pc/git/godot4.2.2-stable/bin/godot.linuxbsd.editor.x86_64.llvm.mono: symbol lookup error: /home/pc/git/godot4.2.2-stable/bin/libmylib.linuxbsd.editor.x86_64.llvm.so: undefined symbol: Variantcv6StringEv

If i check libmylib.linuxbsd.editor.x86_64.llvm.so, it contains the symbols of the lib, and godot.linuxbsd.editor.x86_64.llvm.mono contains Variantcv6StringEv, so maybe something in the .so file is not linked to the .mono file, also i had to add another copy of libmylib.so in the folder.

I’d really like to know how why the symbols are not found or what i could do to fix this.

edition:
I read my question and i think my english is bad so i rephrased a bit my question for clarity,

I followed this tutorial: “Custom modules in C++ — Godot Engine (stable) documentation in English”,
To make the link with gdscript and an external lib i created a class like this one:
class Summator : public RefCounted {
GDCLASS(Summator, RefCounted);

int count;


then in a .h file:
a method like this one:
void Summator::add(int p_value) {
count += p_value;
}
and register the methods with gdscript:
void Summator::_bind_methods() {
ClassDB::bind_method(D_METHOD(“add”, “value”), &Summator::add);
}
But if i want to use a custom class as argument of Summator::add, gdscript will complain when compiling saying something like it is not a registered as data type that can be a “Variant”.
So logically(?) i tried a “String” from #include “core/string/ustring.h” as argument because it seemed to belong to that list of registered data types, and it compiled but the error came when using gdscript in the editor instead (undefined symbol).

Just asking for advices or infos i may have missed somewhere.

Fixed because debug_symbols=yes was not enough it needed dev_build=yes to link correctly to the lib.