Skip to content
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

error: 'const void*' is not a pointer-to-object type #1790

Closed
tbillion opened this issue Aug 22, 2022 · 10 comments · Fixed by nRF24/RF24#864
Closed

error: 'const void*' is not a pointer-to-object type #1790

tbillion opened this issue Aug 22, 2022 · 10 comments · Fixed by nRF24/RF24#864

Comments

@tbillion
Copy link

tbillion commented Aug 22, 2022

Description
/home/t/Arduino/libraries/ArduinoJson/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'typename ArduinoJson6194_F1::enable_if<ArduinoJson6194_F1::is_pointer::value, T>::type ArduinoJson6194_F1::pgm_read(const void*) [with T = const arduino::__FlashStringHelper*; typename ArduinoJson6194_F1::enable_if<ArduinoJson6194_F1::is_pointer::value, T>::type = const arduino::__FlashStringHelper*]':
/home/t/Arduino/libraries/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:12: required from here
/home/t/Arduino/libraries/RF24/RF24_config.h:206:38: error: 'const void*' is not a pointer-to-object type
206 | #define pgm_read_ptr(p) (*(p))
| ~^~~~~
exit status 1

Troubleshooter's report

  1. The issue happens at compile time
  2. The error is not in the list

Environment

  • Microcontroller: pico
  • Core/Framework: ear philhower most recent
  • IDE: 1.8.16

Reproduction code

just adding the library throws the error , no actual code to perform actions has been added

Remarks
nope would just like it to work.

edit

it has something to do with the order in which it is added to the project ...
if i add them like this it will not compile.


#include <FanController.h>
#include <WS2812FX.h>
#include "namedColors256.h"
#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include <SPI.h>
#include <EEPROM.h>
#include <LittleFS.h>
#include <ArduinoJson.h>

if i add them like this it will compile.

#include <ArduinoJson.h>
#include <FanController.h>
#include <WS2812FX.h>
#include "namedColors256.h"
#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include <SPI.h>
#include <EEPROM.h>
#include <LittleFS.h>
@bblanchon
Copy link
Owner

Hi @tbillion,

'const void*' is not a pointer-to-object type

This error is in the list. Please look again.

Best regards,
Benoit

@bblanchon bblanchon changed the title not working. error: 'const void*' is not a pointer-to-object type Aug 23, 2022
@bblanchon
Copy link
Owner

Related to arduino/ArduinoCore-API#118.
Duplicate of #1442, #1519, #1536, #1591, and #1676.

@bblanchon bblanchon closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
bblanchon added a commit to bblanchon/RF24 that referenced this issue Aug 23, 2022
Calling this macro caused the following error: 'const void*' is not a pointer-to-object type
bblanchon added a commit to bblanchon/RF24 that referenced this issue Aug 23, 2022
Calling this macro caused the following error: 'const void*' is not a pointer-to-object type
@bblanchon
Copy link
Owner

In this case, it seems that the bug doesn't come from the core but from the RF24 library.
I'll open a PR.

@2bndy5
Copy link

2bndy5 commented Sep 3, 2022

@tbillion It would help to know the version of RF24 that you are using, so I can reproduce this.

@bblanchon
Copy link
Owner

bblanchon commented Sep 3, 2022

@2bndy5, here is a complete repro:

#include <RF24.h>
#include <ArduinoJson.h>

void setup() {}
void loop() {}

With RF24 v1.4.5, these four lines produce an error on some Arduino cores:

Core Status
Adafruit SAMD OK
Arduino AVR OK
Arduino Mbed Error
Arduino megaAVR OK
Arduino SAMD OK
ESP32 OK
ESP8266 OK
Raspberry Pi RP2040 Error
STM32 OK
STM32F1 OK
STM32F4 Error
Teensy 4 OK
Teensy 3 OK
Infineon XMC Error

@2bndy5
Copy link

2bndy5 commented Sep 3, 2022

Thanks, that helps narrow down the cores, but the error in the OP doesn't seem to align with v1.4.5. I have a hunch at which line is the problem, but I just wanted to be sure.

@tbillion
Copy link
Author

tbillion commented Sep 4, 2022

1.4.3

If it is not a breaking change I will upgrade and see if it persists .

@2bndy5
Copy link

2bndy5 commented Sep 5, 2022

Avoid v1.4.4 because there is a known bug which was fixed in v1.4.5 (the latest). However, updating the lib won't likely fix this problem. I just wanted to know what version you were using so I could find the exact line that was causing the problem. Thank you for the response.

2bndy5 pushed a commit to nRF24/RF24 that referenced this issue Sep 6, 2022
Calling this macro caused the following error: 'const void*' is not a pointer-to-object type when defined by another library (in this instance ArduinoJSON)

see bblanchon/ArduinoJson/#1790
@2bndy5
Copy link

2bndy5 commented Sep 6, 2022

I will let you know when the fix for this has been released (likely going to be v1.4.6) for the Arduino Library Manager... It should be soon, but I wanted to go through and fix the other pgm_read_* macros and add printf_P support to the arduino-pico core (+ ESP32/8266 cores).

@2bndy5
Copy link

2bndy5 commented Sep 18, 2022

I just released v1.4.6 which includes the fix for this. Please wait at least 24 hours for the release to get picked up by the Arduino Lib Manager, then update and enjoy...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants