Skip to content

change byte to uint8_t to avoid naming conflict with ESP8266 toolchain #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2022

Conversation

jnslr
Copy link
Contributor

@jnslr jnslr commented May 7, 2022

I am using this library with ESP8266. The latest version (2.0.9) was causing a naming conflict with the Arduino toolchain.
This commit should fix the issue for ESP8266 users.

Compiling .pio\build\D1Mini\lib2ea\SparkFun BME280@src-c50b57925febe6e2911b52ed12ba3848\SparkFunBME280.cpp.o
Compiling .pio\build\D1Mini\lib3db\BME280\bme280.cpp.o
In file included from lib\BME280/bme280.h:10,
                 from src\main.cpp:12:
.pio\libdeps\D1Mini\SparkFun BME280@src-c50b57925febe6e2911b52ed12ba3848\src/SparkFunBME280.h:227:68: error: reference to 'byte' is ambiguous
  227 |  void readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale = 0);
      |                                                                    ^~~~
In file included from c:\users\xxx\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\10.3.0\cmath:42,
                 from c:\users\xxx\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\10.3.0\math.h:36,
                 from C:\Users\xxx\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:34,
                 from src\main.cpp:3:
c:\users\xxx\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\10.3.0\bits\cpp_type_traits.h:404:30: note: candidates are: 'enum class std::byte' 
  404 |   enum class byte : unsigned char;
      |                              ^~~~
In file included from src\main.cpp:3:
C:\Users\xxx\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:160:17: note:                 'typedef uint8_t byte'
  160 | typedef uint8_t byte;
      |                 ^~~~
In file included from lib\BME280/bme280.h:10,
                 from src\main.cpp:12:
.pio\libdeps\D1Mini\SparkFun BME280@src-c50b57925febe6e2911b52ed12ba3848\src/SparkFunBME280.h:227:68: error: 'byte' has not been declared
  227 |  void readAllMeasurements(BME280_SensorMeasurements *measurements, byte tempScale = 0);
      |                                                                    ^~~~
*** [.pio\build\D1Mini\src\main.cpp.o] Error 1

@nseidle
Copy link
Member

nseidle commented May 9, 2022

Very good. Thank you!

@nseidle nseidle merged commit 8806f66 into sparkfun:master May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy