Hi,
I'm trying to compile a C/C++ project for native AROS, but I'm getting some errors when I try to include <string>.
Is there something missing?
[code]
In file included from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/x86_64-aros/bits/c++locale.h:41,
from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/bits/localefwd.h:40,
from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/string:43,
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/clocale:53:11: error: 'lconv' has not been declared in '::'
53 | using ::lconv;
| ^~~~~
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/clocale:54:11: error: 'setlocale' has not been declared in '::'
54 | using ::setlocale;
| ^~~~~~~~~
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/clocale:55:11: error: 'localeconv' has not been declared in '::'
55 | using ::localeconv;
| ^~~~~~~~~~
...
In file included from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/bits/localefwd.h:40,
from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/string:43,
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/x86_64-aros/bits/c++locale.h: In function 'int std::__convert_from_v(int* const&, char*, int, const char*, ...)':
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/x86_64-aros/bits/c++locale.h:60:21: error: '::setlocale' has not been declared
60 | char* __old = ::setlocale(LC_NUMERIC, 0);
| ^~~~~~~~~
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/x86_64-aros/bits/c++locale.h:60:31: error: 'LC_NUMERIC' was not declared in this scope
60 | char* __old = ::setlocale(LC_NUMERIC, 0);
| ^~~~~~~~~~
...
In file included from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/bits/localefwd.h:40,
from /home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/string:43,
/home/peppe/Documents/arosbuilds/toolchain-core-x86_64/lib/gcc/x86_64-aros/10.5.0/include/c++/x86_64-aros/bits/c++locale.h:67:7: error: 'setlocale' is not a member of 'std'
67 | std::setlocale(LC_NUMERIC, "C");
| ^~~~~~~~~
[/code]
It seems to me that the SDK locale.h header that is supposed to provide the "missing" function is somehow being substituted in your build by an locale.h header from other location. It might be down to what you have in the makefile (using -I or -system switches). I tried building this code with crosscompiler and it worked:
[code]
#include <string>
#include <iostream>
int main()
{
std::cout << "Hello" << std::endl;
std::setlocale(LC_NUMERIC, "C");
}
[/code]
Check your crosscompiler if it can build this: x86_64-aros-gcc -c main.c -o main.o