Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

Missing locale c++ includes?

Last updated on 11 hours ago
S
sonountalebanJunior Member
Posted 1 day ago
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?


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");
 | ^~~~~~~~~
R
retrofazaDistro Maintainer
Posted 1 day ago
Why are you including from toolchain-core-x86_64?

- AROS SDK headers available at
/home/peppe/Documents/arosbuilds/core-linux-x86_64-d/bin/linux-x86_64/AROS/Development/include
- AROS SDK libs available at
/home/peppe/Documents/arosbuilds/core-linux-x86_64-d/bin/linux-x86_64/AROS/Development/lib

Maybe this will help Smile
D
deadwoodAROS Dev
Posted 17 hours ago
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:


#include <string>
#include <iostream>

int main()
{
 std::cout << "Hello" << std::endl;
 std::setlocale(LC_NUMERIC, "C");
}


Check your crosscompiler if it can build this: x86_64-aros-gcc -c main.c -o main.o
S
sonountalebanJunior Member
Posted 11 hours ago
Cheers, I already have that path /home/peppe/Documents/arosbuilds/core-linux-x86_64-d/bin/linux-x86_64/AROS/Development/include but I don't know why I added also a couple of sub-folders of it. I've removed all paths but the first one and it builds now. Smile
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.
Users who participated in discussion: deadwood, retrofaza, sonountaleban