gpt4 book ai didi

c - 'sizeof' 对不完整类型问题的无效应用

转载 作者:太空宇宙 更新时间:2023-11-04 07:53:30 25 4
gpt4 key购买 nike

我得到的错误是

“sizeof”对不完整类型“TProgmemRGBGradientPalette_byte* const [] {aka const unsigned char* const []}”的无效应用

在线 46 https://pastebin.com/xhVEnqts .

下面最后一行是第46行:

#define FASTLED_ALLOW_INTERRUPTS 0
#include "FastLED.h"
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WebSocketsClient.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
#include <ArduinoJson.h> // https://github.com/kakopappa/sinric/wiki/How-to-add-dependency-libraries
#include <StreamString.h>

#define DATA_PIN 3
#define LED_TYPE WS2812
#define COLOR_ORDER GRB
#define NUM_LEDS 30 // Change this to reflect the number of LEDs you have
#define BRIGHTNESS 128 // Set Brightness here

CRGB leds[NUM_LEDS];

#define SECONDS_PER_PALETTE 15


ESP8266WiFiMulti WiFiMulti;
WebSocketsClient webSocket;
WiFiClient client;

#define MyApiKey "xxxx" // TODO: Change to your sinric API Key. Your API Key is displayed on sinric.com dashboard
#define MySSID "xxxxx" // TODO: Change to your Wifi network SSID
#define MyWifiPassword "xxxx" // TODO: Change to your Wifi network password

#define HEARTBEAT_INTERVAL 300000 // 5 Minutes

uint64_t heartbeatTimestamp = 0;
bool isConnected = false;

void setPowerStateOnServer(String deviceId, String value);
void setTargetTemperatureOnServer(String deviceId, String value, String scale);

extern const TProgmemRGBGradientPalettePtr gGradientPalettes[];
extern const uint8_t gGradientPaletteCount;

uint8_t gCurrentPaletteNumber = 0;

CRGBPalette16 gCurrentPalette( CRGB::Black);
CRGBPalette16 gTargetPalette( gGradientPalettes[0] );

const uint8_t gGradientPaletteCount =
sizeof( gGradientPalettes) / sizeof( TProgmemRGBGradientPalettePtr );

最佳答案

它外部变量具有未知的编译时间大小。如果你找不到大小,看代码编译器也不会好

关于c - 'sizeof' 对不完整类型问题的无效应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52214551/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com