开源改变世界!!

PlatformIO 编译与“limit.h”冲突 #74

推推 grbl 2年前 (2022-10-19) 126次浏览 0个评论
关闭
连巴赫 打开了这个问题 2018 年 12 月 29 日 · 15 条评论
关闭

PlatformIO 编译与“limit.h”冲突#74

连巴赫 打开了这个问题 on 29 Dec 2018 · 15 条评论

注释

PlatformIO 编译与“limit.h”冲突 #74
贡献者

连巴赫 评论 2018 年 12 月 29 日

你好!
首先,多么伟大的项目!非常感谢!我最近放弃了 Arduino IDE,转而使用 PlatformIO 和 VSCode。许多东西很容易互换。因此,我尝试使用 PIO 编译代码并得到一个编译器错误,指出在 Tasks.h 的此范围内未定义 INT_MAX。所以我去检查,发现Tasks.h包含一个limits.h,但似乎恰好包含grbl_esp32s自己的limits.h而不是esp32库中的一个,因此无法编译。

我已将本地 limits.h 重命名为 grbl_limits.h,对 grbl_limits.cpp 做了同样的事情,并编辑了 grbl.h 中的包含,现在它编译得很好,只有一堆关于未使用变量(主要是任务句柄)的警告。

认为这可能是值得考虑的事情。

再次,很棒的项目!非常感谢!

PlatformIO 编译与“limit.h”冲突 #74
合作者

luc-github 评论 2018 年 12 月 29 日  

我用 Arduino 和所有警告编译,自上次清理以来没有问题,也没有警告
我不使用 platformIO,所以你能分享哪些limits.h文件有冲突吗?(您指的是哪个 Tasks.h)错误应该显示另一个文件的位置。

你也可以分享你看到的警告吗?

谢谢

PlatformIO 编译与“limit.h”冲突 #74
合作者

luc-github 评论 2018 年 12 月 29 日

刚刚更新了来自 ESP32 的最新 git 并且没有冲突 – 可能是您正在使用的本地库?

PlatformIO 编译与“limit.h”冲突 #74
贡献者作者

连巴赫 评论 2018 年 12 月 29 日

是的,我看到该项目专注于 Arduino IDE,所以它在那里编译得很好并不奇怪,很确定它只是使用不同的 IDE 弹出的东西。但事实上这很容易解决了这个问题,这让我认为消除常见文件名的歧义可能是一个好主意。task.h 位于 ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos (使用 MacOS)。

这是构建输出的粘贴:https ://pastebin.com/8Zddh1nb

PlatformIO 编译与“limit.h”冲突 #74
贡献者

全能蛙 评论 2018 年 12 月 29 日

我不想劫持这个问题,但我也尝试使用 platformio 并失败了。
已将其发布在这里espressif/arduino-esp32#2083但没有成功。
所以不确定这是否有帮助(有另一个构建输出)。

问题仍然存在,这里有一个带有当前代码的新构建输出:

******************************************************************************************************************************************************************************************************************
Obsolete PIO Core v3.6.1 is used (previous was 3.6.2a3)
Please remove multiple PIO Cores from a system:
https://docs.platformio.org/page/faq.html#multiple-pio-cores-in-a-system
******************************************************************************************************************************************************************************************************************
Processing nodemcu-32s (platform: espressif32; board: nodemcu-32s; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html
PLATFORM: Espressif 32 > NodeMCU-32S
SYSTEM: ESP32 240MHz 320KB RAM (4MB Flash)
DEBUG: CURRENT(esp-prog) EXTERNAL(esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
Converting Grbl_Esp32.ino
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <BluetoothSerial> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <FS> 1.0
|-- <WebServer> 1.0
|   |-- <WiFi> 1.0
|   |-- <FS> 1.0
|-- <SPI> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <Preferences> 1.0
|-- <EEPROM> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
|-- <WiFi> 1.0
|-- <WebSockets> 2.1.2
|   |-- <WiFi> 1.0
|   |-- <SPI> 1.0
|   |-- <WiFiClientSecure> 1.0
|   |   |-- <WiFi> 1.0
|-- <SD(esp32)> 1.0.5
|   |-- <FS> 1.0
|   |-- <SPI> 1.0
|-- <ESP32SSPD> 1.0
|   |-- <WiFi> 1.0
Compiling .pioenvs/nodemcu-32s/src/Grbl_Esp32.ino.cpp.o
Compiling .pioenvs/nodemcu-32s/src/coolant_control.cpp.o
Compiling .pioenvs/nodemcu-32s/src/eeprom.cpp.o
Compiling .pioenvs/nodemcu-32s/src/gcode.cpp.o
In file included from Grbl_Esp32/grbl.h:36:0,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from /home/user/Bastelprojekte/3rd/Grbl_Esp32/Grbl_Esp32/Grbl_Esp32.ino:21:
Grbl_Esp32/nuts_bolts.h:60:0: warning: "bit" redefined
#define bit(n) (1 << n)
^
In file included from /tmp/tmpWr4ox2:1:0:
/home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:105:0: note: this is the location of the previous definition
#define bit(b) (1UL << (b))
^
In file included from Grbl_Esp32/grbl.h:36:0,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/coolant_control.cpp:24:
Grbl_Esp32/nuts_bolts.h:60:0: warning: "bit" redefined
#define bit(n) (1 << n)
^
In file included from Grbl_Esp32/grbl.h:26:0,
from Grbl_Esp32/coolant_control.cpp:24:
/home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:105:0: note: this is the location of the previous definition
#define bit(b) (1UL << (b))
^
In file included from Grbl_Esp32/grbl.h:36:0,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/eeprom.cpp:21:
Grbl_Esp32/nuts_bolts.h:60:0: warning: "bit" redefined
#define bit(n) (1 << n)
^
In file included from Grbl_Esp32/grbl.h:26:0,
from Grbl_Esp32/eeprom.cpp:21:
/home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:105:0: note: this is the location of the previous definition
#define bit(b) (1UL << (b))
^
In file included from Grbl_Esp32/grbl.h:36:0,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/gcode.cpp:25:
Grbl_Esp32/nuts_bolts.h:60:0: warning: "bit" redefined
#define bit(n) (1 << n)
^
In file included from Grbl_Esp32/grbl.h:26:0,
from Grbl_Esp32/gcode.cpp:25:
/home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:105:0: note: this is the location of the previous definition
#define bit(b) (1UL << (b))
^
In file included from /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:33:0,
from Grbl_Esp32/grbl.h:26,
from Grbl_Esp32/coolant_control.cpp:24:
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h: In function 'BaseType_t xTaskCreate(TaskFunction_t, const char*, uint32_t, void*, UBaseType_t, void**)':
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:96:24: error: 'INT_MAX' was not declared in this scope
#define tskNO_AFFINITY INT_MAX
^
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:438:110: note: in expansion of macro 'tskNO_AFFINITY'
return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY );
^
In file included from /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:33:0,
from /tmp/tmpWr4ox2:1:
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h: In function 'BaseType_t xTaskCreate(TaskFunction_t, const char*, uint32_t, void*, UBaseType_t, void**)':
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:96:24: error: 'INT_MAX' was not declared in this scope
#define tskNO_AFFINITY INT_MAX
^
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:438:110: note: in expansion of macro 'tskNO_AFFINITY'
return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY );
^
In file included from /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:33:0,
from Grbl_Esp32/grbl.h:26,
from Grbl_Esp32/eeprom.cpp:21:
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h: In function 'BaseType_t xTaskCreate(TaskFunction_t, const char*, uint32_t, void*, UBaseType_t, void**)':
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:96:24: error: 'INT_MAX' was not declared in this scope
#define tskNO_AFFINITY INT_MAX
^
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:438:110: note: in expansion of macro 'tskNO_AFFINITY'
return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY );
^
In file included from /home/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:33:0,
from Grbl_Esp32/grbl.h:26,
from Grbl_Esp32/gcode.cpp:25:
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h: In function 'BaseType_t xTaskCreate(TaskFunction_t, const char*, uint32_t, void*, UBaseType_t, void**)':
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:96:24: error: 'INT_MAX' was not declared in this scope
#define tskNO_AFFINITY INT_MAX
^
/home/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos/freertos/task.h:438:110: note: in expansion of macro 'tskNO_AFFINITY'
return xTaskCreatePinnedToCore( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pvCreatedTask, tskNO_AFFINITY );
^
In file included from Grbl_Esp32/grbl.h:77:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/coolant_control.cpp:24:
Grbl_Esp32/servo_pen.h: At global scope:
Grbl_Esp32/servo_pen.h:70:21: warning: 'servoSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t servoSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:78:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/coolant_control.cpp:24:
Grbl_Esp32/solenoid_pen.h:47:21: warning: 'solenoidSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t solenoidSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:54:0,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/coolant_control.cpp:24:
Grbl_Esp32/serial.h:40:21: warning: 'serialCheckTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t serialCheckTaskHandle = 0;
^
*** [.pioenvs/nodemcu-32s/src/coolant_control.cpp.o] Error 1
In file included from Grbl_Esp32/grbl.h:77:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/eeprom.cpp:21:
Grbl_Esp32/servo_pen.h: At global scope:
Grbl_Esp32/servo_pen.h:70:21: warning: 'servoSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t servoSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:78:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/eeprom.cpp:21:
Grbl_Esp32/solenoid_pen.h:47:21: warning: 'solenoidSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t solenoidSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:54:0,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/eeprom.cpp:21:
Grbl_Esp32/serial.h:40:21: warning: 'serialCheckTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t serialCheckTaskHandle = 0;
^
*** [.pioenvs/nodemcu-32s/src/eeprom.cpp.o] Error 1
In file included from Grbl_Esp32/grbl.h:77:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from /home/user/Bastelprojekte/3rd/Grbl_Esp32/Grbl_Esp32/Grbl_Esp32.ino:21:
Grbl_Esp32/servo_pen.h: At global scope:
Grbl_Esp32/servo_pen.h:70:21: warning: 'servoSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t servoSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:78:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from /home/user/Bastelprojekte/3rd/Grbl_Esp32/Grbl_Esp32/Grbl_Esp32.ino:21:
Grbl_Esp32/solenoid_pen.h:47:21: warning: 'solenoidSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t solenoidSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:54:0,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from /home/user/Bastelprojekte/3rd/Grbl_Esp32/Grbl_Esp32/Grbl_Esp32.ino:21:
Grbl_Esp32/serial.h:40:21: warning: 'serialCheckTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t serialCheckTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:77:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/gcode.cpp:25:
Grbl_Esp32/servo_pen.h: At global scope:
Grbl_Esp32/servo_pen.h:70:21: warning: 'servoSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t servoSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:78:0,
from Grbl_Esp32/jog.h:26,
from Grbl_Esp32/grbl.h:57,
from Grbl_Esp32/stepper.h:34,
from Grbl_Esp32/grbl.h:56,
from Grbl_Esp32/spindle_control.h:24,
from Grbl_Esp32/grbl.h:55,
from Grbl_Esp32/serial.h:24,
from Grbl_Esp32/grbl.h:54,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/gcode.cpp:25:
Grbl_Esp32/solenoid_pen.h:47:21: warning: 'solenoidSyncTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t solenoidSyncTaskHandle = 0;
^
In file included from Grbl_Esp32/grbl.h:54:0,
from Grbl_Esp32/report.h:24,
from Grbl_Esp32/grbl.h:53,
from Grbl_Esp32/motion_control.h:30,
from Grbl_Esp32/grbl.h:49,
from Grbl_Esp32/eeprom.h:24,
from Grbl_Esp32/grbl.h:46,
from Grbl_Esp32/system.h:23,
from Grbl_Esp32/grbl.h:42,
from Grbl_Esp32/settings.h:28,
from Grbl_Esp32/grbl.h:41,
from Grbl_Esp32/tdef.h:4,
from Grbl_Esp32/grbl.h:38,
from Grbl_Esp32/config.h:40,
from Grbl_Esp32/grbl.h:35,
from Grbl_Esp32/gcode.cpp:25:
Grbl_Esp32/serial.h:40:21: warning: 'serialCheckTaskHandle' defined but not used [-Wunused-variable]
static TaskHandle_t serialCheckTaskHandle = 0;
^
*** [.pioenvs/nodemcu-32s/src/Grbl_Esp32.ino.cpp.o] Error 1
*** [.pioenvs/nodemcu-32s/src/gcode.cpp.o] Error 1
PlatformIO 编译与“limit.h”冲突 #74
贡献者作者

连巴赫 评论 2018 年 12 月 29 日

正是这个问题。将limits.h 和limits.cpp 重命名为grbl_limits,更改grbl.h 中的include,如果将#ifndef LIMITS_H 更改为GRBL_LIMITS_H 不会有任何影响,它应该可以编译。

PlatformIO 编译与“limit.h”冲突 #74
贡献者

全能蛙 评论 2018 年 12 月 29 日

@lienbacher你是对的,这解决了问题。
构建贯穿。无法检查二进制文件是否正确,因为我目前不在家,但看起来很有希望。

你会做PR吗?

PlatformIO 编译与“limit.h”冲突 #74
所有者

婚戒 评论 2018 年 12 月 29 日

我之前还必须处理其他一些类似的问题。继续做一个公关。由于旅行,可能要一个多星期才能合并它。

请在每个文件的顶部附近添加注释,说明文件重命名的原因。

PlatformIO 编译与“limit.h”冲突 #74
贡献者作者

连巴赫 评论 2018 年 12 月 30 日

再次提交 PR,感谢您的出色工作!

PlatformIO 编译与“limit.h”冲突 #74

我在最新的主分支中遇到了类似的错误:

...
Indexing .pio/build/nodemcu-32s/libaf9/libUpdate.a
Compiling .pio/build/nodemcu-32s/libccd/EEPROM/EEPROM.cpp.o
Archiving .pio/build/nodemcu-32s/lib96a/libArduinoOTA.a
Indexing .pio/build/nodemcu-32s/lib96a/libArduinoOTA.a
Compiling .pio/build/nodemcu-32s/libad2/Grbl_Esp32/Grbl_Esp32/BTconfig.cpp.o
Compiling .pio/build/nodemcu-32s/libad2/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp.o
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:36:8: error: 'TaskHandle_t' does not name a type
 static TaskHandle_t solenoidSyncTaskHandle = 0;
        ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:37:8: error: 'TaskHandle_t' does not name a type
 static TaskHandle_t atariHomingTaskHandle = 0;
        ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:38:1: error: 'int8_t' does not name a type
 int8_t solenoid_pwm_chan_num;
 ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:39:1: error: 'uint16_t' does not name a type
 uint16_t solenoid_pull_count;
 ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:41:1: error: 'uint8_t' does not name a type
 uint8_t homing_phase = HOMING_PHASE_FULL_APPROACH;
 ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:42:1: error: 'uint8_t' does not name a type
 uint8_t current_tool;
 ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp: In function 'void machine_init()':
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:45:5: error: 'solenoid_pull_count' was not declared in this scope
     solenoid_pull_count = 0; // initialize
     ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:46:20: error: 'CLIENT_SERIAL' was not declared in this scope
     grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "Atari 1020 Solenoid");
                    ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:46:35: error: 'MSG_LEVEL_INFO' was not declared in this scope
     grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "Atari 1020 Solenoid");
                                   ^
.pio/libdeps/nodemcu-32s/Grbl_Esp32/Grbl_Esp32/Custom/atari_1020.cpp:46:72: error: 'grbl_msg_sendf' was not declared in this scope
     grbl_msg_sendf(CLIENT_SERIAL, MSG_LEVEL_INFO, "Atari 1020 Solenoid");
...

我对这个世界很陌生,所以也许我做错了什么。我正在使用 PlatformIO。这是我的 main.cpp 中唯一的内容:

#include <Grbl_Esp32/grbl.h>

我像这样安装了这个库:

  1. 去图书馆
  2. 点击安装
  3. 粘贴git@github.com:bdring/Grbl_Esp32.git到第一个字段
  4. 点击安装
  • 它返回了一条成功消息。
PlatformIO 编译与“limit.h”冲突 #74
所有者

婚戒 评论 2020 年 5 月 21 日

没有 main.cpp。这是一个与 Arduino 兼容的项目。

PlatformIO 编译与“limit.h”冲突 #74

我明白了。但是基于这个问题以及这个项目有一个platformio.ini文件的事实,我知道它也适用于 PlatformIO 上的人们。我遇到的问题可能是我没有那么有经验而且我做错了什么。让我们稍微备份一下。

在这个存储库的自述文件中没有具体的步骤如何编译它。上面写着:

有关使用 Grbl 的基本说明,请使用gnea/grbl wiki

所以我按照他们的步骤如何编译他们的项目。步骤之一是:

单击文件下拉菜单,导航到示例-> Grbl,然后选择 GrblUpload

该示例仅包含以下行:

#include <grbl.h>

这也是如何配置该项目以进行编译吗?

如上所述,我将此项目安装为 PlatformIO 库,但 grbl.h 不可用。感谢 VSCode 的自动完成功能,我能够在这样的文件夹中找到它:

#include <Grbl_Esp32/grbl.h>
PlatformIO 编译与“limit.h”冲突 #74

您是否尝试过“platformio run”而不更改树中的任何内容?

PlatformIO 编译与“limit.h”冲突 #74

感谢您的提示!我从您的说明中了解到,我不应该将此项目用作库,而是直接编译它。我理解正确吗?

所以我克隆了这个存储库,在 VSCode 中打开它,然后单击 Build 选项。这是输出:

> Executing task: platformio run <

Processing nodemcu-32s (platform: espressif32; board: nodemcu-32s; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/nodemcu-32s.html
PLATFORM: Espressif 32 1.12.1 > NodeMCU-32S
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 3.10004.200129 (1.0.4) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
Converting Grbl_Esp32.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for arduinoWebSockets library in registry
Found: https://platformio.org/lib/show/6149/ArduinoWebsockets
LibraryManager: Installing id=6149
ArduinoWebsockets @ 0.4.17 is already installed
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <TMCStepper> 0.6.2
|   |-- <SPI> 1.0
|-- <ESP32SSPD> 1.0
|   |-- <WiFi> 1.0
|-- <BluetoothSerial> 1.0
|-- <Preferences> 1.0
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
|-- <WebServer> 1.0
|   |-- <WiFi> 1.0
|   |-- <FS> 1.0
|-- <EEPROM> 1.0.3
|-- <SD(esp32)> 1.0.5
|   |-- <FS> 1.0
|   |-- <SPI> 1.0
|-- <SPI> 1.0
|-- <WiFiClientSecure> 1.0
|   |-- <WiFi> 1.0
|-- <WebSockets> 2.1.2
|   |-- <SPI> 1.0
|   |-- <WiFi> 1.0
|   |-- <WiFiClientSecure> 1.0
|   |   |-- <WiFi> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <ArduinoOTA> 1.0
|   |-- <Update> 1.0
|   |-- <WiFi> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
Building in release mode
Compiling .pio/build/nodemcu-32s/src/BTconfig.cpp.o
Compiling .pio/build/nodemcu-32s/src/Grbl_Esp32.ino.cpp.o
Compiling .pio/build/nodemcu-32s/src/commands.cpp.o
Compiling .pio/build/nodemcu-32s/src/coolant_control.cpp.o
Compiling .pio/build/nodemcu-32s/src/custom_code.cpp.o
Compiling .pio/build/nodemcu-32s/src/espresponse.cpp.o
Compiling .pio/build/nodemcu-32s/src/gcode.cpp.o
Assembler messages:
Fatal error: can't create .pio/build/nodemcu-32s/src/custom_code.cpp.o: No such file or directory
*** [.pio/build/nodemcu-32s/src/custom_code.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/nodemcu-32s/src/commands.cpp.o: No such file or directory
*** [.pio/build/nodemcu-32s/src/commands.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/nodemcu-32s/src/espresponse.cpp.o: No such file or directory
*** [.pio/build/nodemcu-32s/src/espresponse.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/nodemcu-32s/src/gcode.cpp.o: No such file or directory
*** [.pio/build/nodemcu-32s/src/gcode.cpp.o] Error 1
FileNotFoundError: [Errno 2] No such file or directory: '/home/jan/development/Grbl_Esp32/.pio/build/nodemcu-32s/.sconsign38.db.dblite':
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1381:
    _exec_main(parser, values)
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1344:
    _main(parser)
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1119:
    nodes = _build_targets(fs, options, targets, target_top)
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1318:
    jobs.run(postfunc = jobs_postfunc)
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Job.py", line 113:
    postfunc()
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1315:
    SCons.SConsign.write()
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/SConsign.py", line 117:
    syncmethod()
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 161:
    self._os_unlink(self._file_name)
Exception ignored in: <function dblite.__del__ at 0x7f909b393af0>
Traceback (most recent call last):
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 143, in __del__
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 140, in close
  File "/home/jan/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 161, in sync
FileNotFoundError: [Errno 2] No such file or directory: '/home/jan/development/Grbl_Esp32/.pio/build/nodemcu-32s/.sconsign38.db.dblite'
============================================================ [FAILED] Took 9.72 seconds ============================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

所以我以这种方式得到一个不同的错误。

PlatformIO 编译与“limit.h”冲突 #74

你做了正确的事情。如果你再试一次,它有可能会起作用。我已经看到 VSCode 发生了类似的奇怪事情。我怀疑这是 Intellisense 和 platformio 之间的交互。我认为 Intellisense – 或其他一些“帮助”进程 – 可能会尝试访问出现在树中的文件,以便为它们编制索引。当它打开一个文件时,它会暂时锁定文件并阻止编译过程访问它们。“智能”IDE 需要付出一定的代价。

PlatformIO 编译与“limit.h”冲突 #74

就是这样。谢谢!

我的问题的解决方法是转到 VSCode 设置,搜索“排除”关键字并添加**/.pio模式。然后重新启动 VSCode 并[SUCCESS] Took 73.99 seconds在最后构建。?

喜欢 (0)

您必须 登录 才能发表评论!