-
Notifications
You must be signed in to change notification settings - Fork 107
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
Compile error: Help needed with Universal_Sensor_beta - choose protocol #59
Comments
I tried to find out what's going on and searched for "undefined reference to vtable for" and stumbled upon this article: https://stackoverflow.com/questions/3065154/undefined-reference-to-vtable User iammilind says:
Though this is Arduino and not Qt I thought it would be worth a try - as the issue is comming from the object file (FDRS_Universal_Sensor.ino.o) I added #include "fdrs_sensor.cpp" below the corresponding header file into the Sensor sketch and - voila, it compiles! But... now I'm getting a new compiler error:
Which makes sense for me, as I couldn't find a place, where So still I do not understand what's going on. Anyone who can help? |
I'm still doomed with the undefined reference to vtable issue. But the issue with the not declared sleep_time I fixed with c6b1614 |
You tried installing and switching the "includes" to <includes>? That is my only thought. I assume Binder will have some insight... |
I think so - actually I tried out all combinations I think. I just stepped one step back again and try to find a viable info about the include order of the Arduino IDE. Will share if I found out more. |
@Gulpman, I get the same error. Here's what I did to resolve. I'm no expert but the issue must be the order in which the compile interprets the files. Here's what I did and compiles properly on my Linux system using Arduino 1.8.19
Those steps seem to result in a successful compilation. |
Definitively! I have read so many tutorials/documentations telling totally different stuff about how ArduinoIDE is handling compiling and linking... The consens was to use something different as the way Arduino IDE is handling this is somehow unpredictable. OT: I would like to try out Platform.IO. From what I read, these kind of issues are explaind better when arising so fixing should be easier. As I think you are using Platform.IO (see #47 ;) ) - can you give a short summary on how to import this repo there? I tried to import it via the import dialogue but it complains that there is no .ino file.
Works! Thank you very much @aviateur17 I was playing around with the folder structure of the library in my local copy as I stumbled upon the Arduino library specification on my hunt for the root case as well. Reason is, that I'm unhappy with the fact, that each example holds the library files. I think they should be included from the library path (root dir or from a src subdir). I will need to test that approach a little bit more but overall I think this is something which must be done (get rid of redundancy) to have a clean project. Unfortunately I'm a noob on these things so I will not change it until I got it in my brain what the correct way to do it is. :) But this topic can be closed - will open a new one on the structure if I know better. Thanks again @aviateur17 |
Glad it worked for you! Going to VSCode and PlatformIO is a lot of work but well worth it in my opinion. I'm going on a week long holiday soon and so I don't have time to type up everything right now but I can do that in a week or so. Basically
Here is basically my code for platformio.ini for ESP32. ESP8266 is a bit different.
platformio.ini for ESP8266 - I only have ESP01 or ESP01S boards
|
Fixed timmbogner#59 with the help of aviateur17. Explanation here: timmbogner#59 (comment)
I wanted to clean-up the configuration for the Universal_Sensor_beta. My intention was, that the user should not edit the class files but only the sensor sketch itself (.ino file) or the specific configuration file (fdrs_sensor_config.h).
In the current implementation of Universal_Sensor_beta the protocol being used can be activated by uncommenting one or the other
within
Farm-Data-Relay-System\examples\Universal_Sensor_beta\fdrs_sensor.h
Therefore I wanted to move the declaration, which protocoll the Universal_Sensor is supposed to use to the sensor configuration file:
Actually it is defined within fdrs_sensor.h, which compiles without issues.
The end user shouldn't edit fdrs_sensor.h. So I wanted to move the #define to fdrs_sensor_config.h:
But this leads to a compilation error:
I tried to do the define as first statement in the ino-file, to be 100% sure it is defined prior to any use of it but it throws the same compiler error.
I also tried to put the sketch and all includes into the root directory and into the src directory (in a temporary library, to be sure ther is no interference with anything else but I do still get the compile error.
@Devilbinder or anyone else: Can someone explain why the #define must be in the fdrs_sensor.h? And what can I do, to move it to the sketch or fdrs_sensor_config.h? Both of them should be known to fdrs_sensor.h or am I getting something wrong here?
The text was updated successfully, but these errors were encountered: