Comments (7)
Probably, my avr-g++ version is too old...
from fast-arduino-lib.
Ok, I used older syntax for nested namespaces in soft_uart.h, line 67
namespace serial { namespace soft { ...}}
...and the compilation was successful.
I thought, that the compiler's switch '-std=c++17' would do all magic, even if the 'avr-g++' version is not the latest, but it would not...
Maybe, it is better to use the old (and ugly) syntax, the most users have older compilers - even me with Debian Unstable distribution.
Best regards, Susnicek
from fast-arduino-lib.
Hi Suscnicek,
yes your avr-g++ version is pretty old. Nested namespaces (part of C++17 standard) are not supported by g++ version before 6.0.
However, even g++6.0 is not supporting all C++17 standard features and I am not sure 6.0 support would be enough for FastArduino.
In particular, there is much better support for constexpr
functions in C++17 which allow simpler definitions of such functions (without such support, it is not possible to have more than one return
in a constexpr
function, which makes writing such functions more complex and reduces their readability).
For what it's worth, FastArduino is built (on my setup) with avr-g++ 7.4 with various C++17 features (nested namespaces and improved constexpr functions at least), and I don't have plans to support older versions as this is the recipe for bad-looking source code; note that even g++7.4 is not that new actually (released in 2017 I think), but this was the latest version available for AVR targets on fedora distrib, which is my distrib of choice on all my workstations). I generally reserve Debian for servers only (plus Raspberry Pi with raspbian distro).
from fast-arduino-lib.
Dear @jfpoilpret ,
thank you for your answer. It is ok for me now, I can use the libraries with the slight modification (or maybe later I will try to compile the avr-gcc sources etc.).
One think is not clear to me: the compiler complained on the nested namespace in 'soft_uart.h' but it did not complain on the same thing in 'uart.h'. I only needed to modify the file 'uart_soft.h' to compile the library. Strange...
Susnicek
from fast-arduino-lib.
Hi @susnicek
I think the main reason why the compiler did not complain for uart.h
is that it did not compile anything including uart.h
(headers are not compiled during library building only .cpp source files).
soft_uart.h
gets parsed by the compiler because it is included in soft_uart.cpp
which must be compiled.
When you will use (in an application) FastArduino headers, you may get more of this error. In particular, if you use FastArduino headers for devices support, nested namespaces are also used there.
So in the end, you will need to change nested namespaces whenever you include headers where they exist.
from fast-arduino-lib.
Issue has been answered and can be closed.
from fast-arduino-lib.
Yes, you were right.
Thank you!
from fast-arduino-lib.
Related Issues (20)
- Simplify some FastArduino API/implementation HOT 2
- Improve API documentation by fixing doxygen warnings HOT 1
- Add support for Grove 125KHz RFID reader HOT 1
- Improve software UART for slow rates
- Add support for RC522 (RFID chip) HOT 1
- Add support for Nokia 5110 LCD display HOT 1
- Add support for ILI9340 color display
- The Functor in I2C implementation appears to not working as expected HOT 4
- Allow SPI to work without a CS pin HOT 2
- Add support for Arduino LCD HOT 1
- Add support for Adafruit Bluefruit LE SPI Friend
- Add FastDigialPin as type HOT 3
- Improve APIDOC to properly generate sub-namespace docs HOT 1
- Compatibility with avr libraries HOT 3
- Renaming library... HOT 2
- Allow real Timer suspend/resume and set timer value HOT 3
- Add support for ATmega644 and 1284 HOT 3
- Queue buffer size waste improvement needed (was: Queue full bug) HOT 6
- Remove included streams.h to avoid conflicts with empty_streams.h HOT 1
- Review (replace?) virtual methods in ostreambuf and futures HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast-arduino-lib.