Must be doing something obviously wrong but have tried and tried to fix it, no luck. Made a sandbox sketch to just get the problem spot fixed, and am still stuck. Have tried numerous iterations starting from the more clean and obvious, to the most cumbersome and explicit, still with no luck.
Am getting this error:
\Greenhouse\Sandbox_1\Sandbox_1.ino:13:1: error: 'p_Sensor_G' does not name a type
p_Sensor_G = &mySensor;
^~~~~~~~~~
exit status 1
Compilation error: 'p_Sensor_G' does not name a type
Got this error:
C:\Users\mydig\AppData\Local\Temp\cceBU1fV.ltrans0.ltrans.o: In function global constructors keyed to 65535_0_GoB_Sensor.cpp.o.4107': <artificial>:(.text.startup+0x60): undefined reference to vtable for GoB_Sensor'
:(.text.startup+0x62): undefined reference to vtable for GoB_Sensor' C:\Users\mydig\AppData\Local\Temp\cceBU1fV.ltrans0.ltrans.o: In function __base_dtor ':
C:\Users\mydig\Documents\Commercial Projects\Greenhouse\Sandbox_1/GoB_Sensor.h:8: undefined reference to vtable for GoB_Sensor' C:\Users\mydig\Documents\Commercial Projects\Greenhouse\Sandbox_1/GoB_Sensor.h:8: undefined reference to vtable for GoB_Sensor'
collect2.exe: error: ld returned 1 exit status
exit status 1
Hmmm maybe didn't include that in my code, but thought I gave all the includes. Anyway, that is already in there, here. UPDATE: See that indeed I did clip the top 3 lines when pasting. But yeah, that library is in the compile [here].
Not sure what you mean about SUCCESS, but it is defined as 1 in the Globals.h file. What are you seeing with it? Can you elaborate?
Also, those virtual functions need to stay virtual as will be overridden in derived classes.
Lastly, how do I set compile warning to ALL? UPDATE: Found it, and set to ALL plus verbose for compile. :-)
reference to vtable for GoB_Sensor' C:\Users\mydig\Documents\Commercial Projects\Greenhouse\Sandbox_1/GoB_Sensor.h:8: undefined reference to vtable for GoB_Sensor'
collect2.exe: error: ld returned 1 exit status
Using library SPI at version 1.0 in folder: C:\Users\mydig\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI
Using library Adafruit GFX Library at version 1.12.4 in folder: C:\Users\mydig\Documents\Arduino\libraries\Adafruit_GFX_Library
Using library Adafruit BusIO at version 1.17.4 in folder: C:\Users\mydig\Documents\Arduino\libraries\Adafruit_BusIO
Using library Wire at version 1.0 in folder: C:\Users\mydig\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire
Using library Adafruit ILI9341 at version 1.6.2 in folder: C:\Users\mydig\Documents\Arduino\libraries\Adafruit_ILI9341
Using library DHT sensor library at version 1.4.6 in folder: C:\Users\mydig\Documents\Arduino\libraries\DHT_sensor_library
Using library Adafruit Unified Sensor at version 1.1.15 in folder: C:\Users\mydig\Documents\Arduino\libraries\Adafruit_Unified_Sensor
exit status 1
You did not follow all the instructions in post #9. If you had, your code that you showed would have compiled and linked, as it did for me.
arduino-cli compile -b arduino:avr:uno --warnings all --output-dir ~/tmp --no-color (in directory: /home/me/Documents/sketchbook/Uno_R3/test)
Sketch uses 15680 bytes (48%) of program storage space. Maximum is 32256 bytes.
Global variables use 498 bytes (24%) of dynamic memory, leaving 1550 bytes for local variables. Maximum is 2048 bytes.
Compilation finished successfully.
Yeah, I need the virtual and was requesting more info on the SUCCESS, what you're seeing as an issue (since it is defined in Globals.h) and not used in the sandbox code.