Hi, I am using sloeber to programm arduino in eclipse IDE.
I am using #defines to enable serial output for debugging. When I am done with debugging I set these #defines to zero so the log messages will not be generated and no processing time is wasted for unneeded messages.
I am not so familar with eclipse, so I hope you may help me with my issue.
As I understand you can define multiple configurations within eclipse / sloeber. So I would like to have a configuration for release and debug.
I created a header file debug_includes/config.h with following content:
#ifndef CONFIGURATION_DEBUG_H_
#define CONFIGURATION_DEBUG_H_
#define PROJECT_CONFIG_IS_DEBUG 1
#define IS_DEBUG_TB6612 1
#define TB6612_ENABLE_OUTPUTS 1
#endif /* CONFIGURATION_DEBUG_H_ */
I included this file as c++ preprocessor file (see screenshot):
Within the IDE it looks good, the debug part is active:
But when I want to build I get the following error:
18:18:41 **** Build of configuration debug for project NRF24L01_receiver ****
"D:\\Sloeber_4.4.0\\arduinoPlugin\\tools\\make\\make" all
'Building file: ..\sloeber.ino.cpp'
'Starting C++ compile'
"D:\Sloeber_4.4.0\arduinoPlugin\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10812 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR -I"D:\Arduino\workspace_git\workspace_new\NRF24L01_receiver\debug_includes" -I"D:\Sloeber_4.4.0\arduinoPlugin\packages\arduino\hardware\avr\1.8.5\cores\arduino" -I"D:\Arduino\libraries\EnhancedServo" -I"D:\Arduino\libraries\MotorDriverTB6612FNG" -I"D:\Sloeber_4.4.0\arduinoPlugin\libraries\RF24\1.4.1" -I"D:\Sloeber_4.4.0\arduinoPlugin\libraries\ArduinoLog\1.1.1" -I"D:\Sloeber_4.4.0\arduinoPlugin\packages\arduino\hardware\avr\1.8.5\libraries\SPI\src" -I"D:\Sloeber_4.4.0\arduinoPlugin\libraries\Servo\1.1.8\src" -I"D:\Sloeber_4.4.0\arduinoPlugin\libraries\RF24\1.4.1\utility" -I"D:\Sloeber_4.4.0\arduinoPlugin\libraries\FastCRC\1.42.0\src" -I"D:\Arduino\libraries\MemoryFree" -I"D:\Sloeber_4.4.0\arduinoPlugin\packages\arduino\hardware\avr\1.8.5\variants\eightanaloginputs" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o"
..\sloeber.ino.cpp:8:1: error: 'null' does not name a type
null
^~~~
In file included from ..\sloeber.ino.cpp:32:0:
D:\Sloeber_4.4.0\arduinoPlugin\libraries\ArduinoLog\1.1.1/ArduinoLog.h: In member function 'void Logging::print(const Printable&, va_list)':
D:\Sloeber_4.4.0\arduinoPlugin\libraries\ArduinoLog\1.1.1/ArduinoLog.h:329:43: warning: unused parameter 'args' [-Wunused-parameter]
void print(const Printable& obj, va_list args)
^~~~
make: *** [subdir.mk:20: sloeber.ino.cpp.o] Error 1
"D:/Sloeber_4.4.0/arduinoPlugin/tools/make/make all" terminated with exit code 2. Build might be incomplete.
18:18:43 Build Failed. 2 errors, 1 warnings. (took 2s.916ms)
The generated sloeber.cpp looks like this:
#include "Arduino.h"
null
#define LED_RIGHT 1
#define IS_MODEL_GENERIC 0
#define IS_MODEL_BULLY 0
#define IS_MODEL_POLICE_PORSCHE 0
....
It does not matter if I choose preprocessor macro file or include file for pointing at the file. The error is the same.
What am I missing? Can anyone help?
Looks like the IDE (editor) is working correctly, but something weird is happening during build.
Thanks a lot, Butch