|
|
Can we use any C++11 features with the latest GCC? |
Posted on: 2018/3/17 8:04
#1 |
|---|---|---|
|
Home away from home
![]()
Joined:
2007/1/26 21:48 From New Zealand
Posts: 2310
|
I've built a GCC cross-compiler, and was hoping to at least use C++11 smart pointers and/or some C++11 features that don't require an updated stdlib. However, when I use -std=C++11, I get whole pages of errors in the header files, e.g.:
/usr/local/amiga/adtools-ppc-cyg64-20170623-404/ppc-amigaos/include/c++/5.4.0/bits/basic_string.h: In function ‘long long int std::__cxx11::stoll(const string&, std::size_t*, int)’:
Yes, errors in the compiler's stdlib header files... Has anyone else had more success? If so, how did you get it working? It's getting rather frustrating not being able to use newer C++ functionality. Hans P.S., Anyone know how to build the *.lha archive for the native GCC when built from the adtools source? Compilation completed, but I've got no idea how to transfer a fully working compiler to my AmigaOS machine. |
|
|
_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. https://keasigmadelta.com/ - more of my work |
||
|
|
Re: Can we use any C++11 features with the latest GCC? |
Posted on: 2018/3/17 10:11
#2 |
|---|---|---|
|
Just can't stay away
![]()
Joined:
2007/7/14 21:30 From Lothric
Posts: 1331
|
What commands you have given so far when building the native compiler?
I don't recall using any C++11 features succesfully yet. Maybe you can borrow smart pointers from boost as a workaround? |
|
|
|
Re: Can we use any C++11 features with the latest GCC? |
Posted on: 2018/3/17 10:55
#3 |
|---|---|---|
|
Just can't stay away
![]() Joined:
2006/11/30 11:30 From Finland
Posts: 1801
|
@Hans
Use -std=gnu++11 instead of -std=c++11. The latter defines __STRICT_ANSI__ which disables newlib functions that are not standard ANSI. |
|
|
|
Re: Can we use any C++11 features with the latest GCC? |
Posted on: 2018/3/17 14:40
#4 |
|---|---|---|
|
Home away from home
![]()
Joined:
2007/1/26 21:48 From New Zealand
Posts: 2310
|
@salass00
The -std=gnu++11 works! Well, it compiles; I haven't tested the binary yet. Thanks for that. Now, if only I could figure out how to package and install the native GCC that I built... Hans |
|
|
_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. https://keasigmadelta.com/ - more of my work |
||


