xengine-qyt 2021-12-30 05:06 采纳率: 89.5%
浏览 24
已结题

VS2019 编译问题

hnode_t HuffmanCodes[] = 提示:error C2099: 初始值设定项不是常量

怎么解决啊


#pragma once
typedef struct hnode_t {
    uint32_t bits;
    uint8_t  size;
} hnode_t;

hnode_t HuffmanCodes[] = {
    (hnode_t){0x1ff8, 13}, (hnode_t){0x7fffd8, 23},
    (hnode_t){0xfffffe2, 28}, (hnode_t){0xfffffe3, 28},
    (hnode_t){0xfffffe4, 28}, (hnode_t){0xfffffe5, 28},
    (hnode_t){0xfffffe6, 28}, (hnode_t){0xfffffe7, 28},
    (hnode_t){0xfffffe8, 28}, (hnode_t){0xffffea, 24},
    (hnode_t){0x3ffffffc, 30}, (hnode_t){0xfffffe9, 28},
    (hnode_t){0xfffffea, 28}, (hnode_t){0x3ffffffd, 30},
    (hnode_t){0xfffffeb, 28}, (hnode_t){0xfffffec, 28},
    (hnode_t){0xfffffed, 28}, (hnode_t){0xfffffee, 28},
    (hnode_t){0xfffffef, 28}, (hnode_t){0xffffff0, 28},
    (hnode_t){0xffffff1, 28}, (hnode_t){0xffffff2, 28},
    (hnode_t){0x3ffffffe, 30}, (hnode_t){0xffffff3, 28},
    (hnode_t){0xffffff4, 28}, (hnode_t){0xffffff5, 28},
    (hnode_t){0xffffff6, 28}, (hnode_t){0xffffff7, 28},
    (hnode_t){0xffffff8, 28}, (hnode_t){0xffffff9, 28},
    (hnode_t){0xffffffa, 28}, (hnode_t){0xffffffb, 28},
    (hnode_t){0x14, 6}, (hnode_t){0x3f8, 10}, (hnode_t){0x3f9, 10},
    (hnode_t){0xffa, 12}, (hnode_t){0x1ff9, 13}, (hnode_t){0x15, 6},
    (hnode_t){0xf8, 8}, (hnode_t){0x7fa, 11}, (hnode_t){0x3fa, 10},
    (hnode_t){0x3fb, 10}, (hnode_t){0xf9, 8}, (hnode_t){0x7fb, 11},
    (hnode_t){0xfa, 8}, (hnode_t){0x16, 6}, (hnode_t){0x17, 6},
    (hnode_t){0x18, 6}, (hnode_t){0x0, 5}, (hnode_t){0x1, 5},
    (hnode_t){0x2, 5}, (hnode_t){0x19, 6}, (hnode_t){0x1a, 6},
    (hnode_t){0x1b, 6}, (hnode_t){0x1c, 6}, (hnode_t){0x1d, 6},
    (hnode_t){0x1e, 6}, (hnode_t){0x1f, 6}, (hnode_t){0x5c, 7},
    (hnode_t){0xfb, 8}, (hnode_t){0x7ffc, 15}, (hnode_t){0x20, 6},
    (hnode_t){0xffb, 12}, (hnode_t){0x3fc, 10}, (hnode_t){0x1ffa, 13},
    (hnode_t){0x21, 6}, (hnode_t){0x5d, 7}, (hnode_t){0x5e, 7},
    (hnode_t){0x5f, 7}, (hnode_t){0x60, 7}, (hnode_t){0x61, 7},
    (hnode_t){0x62, 7}, (hnode_t){0x63, 7}, (hnode_t){0x64, 7},
    (hnode_t){0x65, 7}, (hnode_t){0x66, 7}, (hnode_t){0x67, 7},
    (hnode_t){0x68, 7}, (hnode_t){0x69, 7}, (hnode_t){0x6a, 7},
    (hnode_t){0x6b, 7}, (hnode_t){0x6c, 7}, (hnode_t){0x6d, 7},
    (hnode_t){0x6e, 7}, (hnode_t){0x6f, 7}, (hnode_t){0x70, 7},
    (hnode_t){0x71, 7}, (hnode_t){0x72, 7}, (hnode_t){0xfc, 8},
    (hnode_t){0x73, 7}, (hnode_t){0xfd, 8}, (hnode_t){0x1ffb, 13},
    (hnode_t){0x7fff0, 19}, (hnode_t){0x1ffc, 13},
    (hnode_t){0x3ffc, 14}, (hnode_t){0x22, 6}, (hnode_t){0x7ffd, 15},
    (hnode_t){0x3, 5}, (hnode_t){0x23, 6}, (hnode_t){0x4, 5},
    (hnode_t){0x24, 6}, (hnode_t){0x5, 5}, (hnode_t){0x25, 6},
    (hnode_t){0x26, 6}, (hnode_t){0x27, 6}, (hnode_t){0x6, 5},
    (hnode_t){0x74, 7}, (hnode_t){0x75, 7}, (hnode_t){0x28, 6},
    (hnode_t){0x29, 6}, (hnode_t){0x2a, 6}, (hnode_t){0x7, 5},
    (hnode_t){0x2b, 6}, (hnode_t){0x76, 7}, (hnode_t){0x2c, 6},
    (hnode_t){0x8, 5}, (hnode_t){0x9, 5}, (hnode_t){0x2d, 6},
    (hnode_t){0x77, 7}, (hnode_t){0x78, 7}, (hnode_t){0x79, 7},
    (hnode_t){0x7a, 7}, (hnode_t){0x7b, 7}, (hnode_t){0x7ffe, 15},
    (hnode_t){0x7fc, 11}, (hnode_t){0x3ffd, 14}, (hnode_t){0x1ffd, 13},
    (hnode_t){0xffffffc, 28}, (hnode_t){0xfffe6, 20},
    (hnode_t){0x3fffd2, 22}, (hnode_t){0xfffe7, 20},
    (hnode_t){0xfffe8, 20}, (hnode_t){0x3fffd3, 22},
    (hnode_t){0x3fffd4, 22}, (hnode_t){0x3fffd5, 22},
    (hnode_t){0x7fffd9, 23}, (hnode_t){0x3fffd6, 22},
    (hnode_t){0x7fffda, 23}, (hnode_t){0x7fffdb, 23},
    (hnode_t){0x7fffdc, 23}, (hnode_t){0x7fffdd, 23},
    (hnode_t){0x7fffde, 23}, (hnode_t){0xffffeb, 24},
    (hnode_t){0x7fffdf, 23}, (hnode_t){0xffffec, 24},
    (hnode_t){0xffffed, 24}, (hnode_t){0x3fffd7, 22},
    (hnode_t){0x7fffe0, 23}, (hnode_t){0xffffee, 24},
    (hnode_t){0x7fffe1, 23}, (hnode_t){0x7fffe2, 23},
    (hnode_t){0x7fffe3, 23}, (hnode_t){0x7fffe4, 23},
    (hnode_t){0x1fffdc, 21}, (hnode_t){0x3fffd8, 22},
    (hnode_t){0x7fffe5, 23}, (hnode_t){0x3fffd9, 22},
    (hnode_t){0x7fffe6, 23}, (hnode_t){0x7fffe7, 23},
    (hnode_t){0xffffef, 24}, (hnode_t){0x3fffda, 22},
    (hnode_t){0x1fffdd, 21}, (hnode_t){0xfffe9, 20},
    (hnode_t){0x3fffdb, 22}, (hnode_t){0x3fffdc, 22},
    (hnode_t){0x7fffe8, 23}, (hnode_t){0x7fffe9, 23},
    (hnode_t){0x1fffde, 21}, (hnode_t){0x7fffea, 23},
    (hnode_t){0x3fffdd, 22}, (hnode_t){0x3fffde, 22},
    (hnode_t){0xfffff0, 24}, (hnode_t){0x1fffdf, 21},
    (hnode_t){0x3fffdf, 22}, (hnode_t){0x7fffeb, 23},
    (hnode_t){0x7fffec, 23}, (hnode_t){0x1fffe0, 21},
    (hnode_t){0x1fffe1, 21}, (hnode_t){0x3fffe0, 22},
    (hnode_t){0x1fffe2, 21}, (hnode_t){0x7fffed, 23},
    (hnode_t){0x3fffe1, 22}, (hnode_t){0x7fffee, 23},
    (hnode_t){0x7fffef, 23}, (hnode_t){0xfffea, 20},
    (hnode_t){0x3fffe2, 22}, (hnode_t){0x3fffe3, 22},
    (hnode_t){0x3fffe4, 22}, (hnode_t){0x7ffff0, 23},
    (hnode_t){0x3fffe5, 22}, (hnode_t){0x3fffe6, 22},
    (hnode_t){0x7ffff1, 23}, (hnode_t){0x3ffffe0, 26},
    (hnode_t){0x3ffffe1, 26}, (hnode_t){0xfffeb, 20},
    (hnode_t){0x7fff1, 19}, (hnode_t){0x3fffe7, 22},
    (hnode_t){0x7ffff2, 23}, (hnode_t){0x3fffe8, 22},
    (hnode_t){0x1ffffec, 25}, (hnode_t){0x3ffffe2, 26},
    (hnode_t){0x3ffffe3, 26}, (hnode_t){0x3ffffe4, 26},
    (hnode_t){0x7ffffde, 27}, (hnode_t){0x7ffffdf, 27},
    (hnode_t){0x3ffffe5, 26}, (hnode_t){0xfffff1, 24},
    (hnode_t){0x1ffffed, 25}, (hnode_t){0x7fff2, 19},
    (hnode_t){0x1fffe3, 21}, (hnode_t){0x3ffffe6, 26},
    (hnode_t){0x7ffffe0, 27}, (hnode_t){0x7ffffe1, 27},
    (hnode_t){0x3ffffe7, 26}, (hnode_t){0x7ffffe2, 27},
    (hnode_t){0xfffff2, 24}, (hnode_t){0x1fffe4, 21},
    (hnode_t){0x1fffe5, 21}, (hnode_t){0x3ffffe8, 26},
    (hnode_t){0x3ffffe9, 26}, (hnode_t){0xffffffd, 28},
    (hnode_t){0x7ffffe3, 27}, (hnode_t){0x7ffffe4, 27},
    (hnode_t){0x7ffffe5, 27}, (hnode_t){0xfffec, 20},
    (hnode_t){0xfffff3, 24}, (hnode_t){0xfffed, 20},
    (hnode_t){0x1fffe6, 21}, (hnode_t){0x3fffe9, 22},
    (hnode_t){0x1fffe7, 21}, (hnode_t){0x1fffe8, 21},
    (hnode_t){0x7ffff3, 23}, (hnode_t){0x3fffea, 22},
    (hnode_t){0x3fffeb, 22}, (hnode_t){0x1ffffee, 25},
    (hnode_t){0x1ffffef, 25}, (hnode_t){0xfffff4, 24},
    (hnode_t){0xfffff5, 24}, (hnode_t){0x3ffffea, 26},
    (hnode_t){0x7ffff4, 23}, (hnode_t){0x3ffffeb, 26},
    (hnode_t){0x7ffffe6, 27}, (hnode_t){0x3ffffec, 26},
    (hnode_t){0x3ffffed, 26}, (hnode_t){0x7ffffe7, 27},
    (hnode_t){0x7ffffe8, 27}, (hnode_t){0x7ffffe9, 27},
    (hnode_t){0x7ffffea, 27}, (hnode_t){0x7ffffeb, 27},
    (hnode_t){0xffffffe, 28}, (hnode_t){0x7ffffec, 27},
    (hnode_t){0x7ffffed, 27}, (hnode_t){0x7ffffee, 27},
    (hnode_t){0x7ffffef, 27}, (hnode_t){0x7fffff0, 27},
    (hnode_t){0x3ffffee, 26}, (hnode_t){0x3fffffff, 30},
};

uint32_t HuffmanDecodes[256] = {
    UINT32_C(65538),
    UINT32_C(196612),
    UINT32_C(1507352),
    UINT32_C(327686),
    UINT32_C(720908),
    UINT32_C(458760),
    UINT32_C(589834),
    UINT32_C(2150662193),
    UINT32_C(2150793313),
    UINT32_C(2154004581),
    UINT32_C(2154397807),
    UINT32_C(851982),
    UINT32_C(1114130),
    UINT32_C(2155053172),
    UINT32_C(983056),
    UINT32_C(2149613605),
    UINT32_C(2150465582),
    UINT32_C(1245204),
    UINT32_C(1376278),
    UINT32_C(2150596659),
    UINT32_C(2150924341),
    UINT32_C(2151055415),
    UINT32_C(2151186489),
    UINT32_C(1638426),
    UINT32_C(2687018),
    UINT32_C(1769500),
    UINT32_C(2162722),
    UINT32_C(1900574),
    UINT32_C(2031648),
    UINT32_C(2151514177),
    UINT32_C(2153742434),
    UINT32_C(2154070118),
    UINT32_C(2154266728),
    UINT32_C(2293796),
    UINT32_C(2424870),
    UINT32_C(2154594413),
    UINT32_C(2154725488),
    UINT32_C(2154987637),
    UINT32_C(2555944),
    UINT32_C(2151317570),
    UINT32_C(2151907396),
    UINT32_C(2818092),
    UINT32_C(3735610),
    UINT32_C(2949166),
    UINT32_C(3342388),
    UINT32_C(3080240),
    UINT32_C(3211314),
    UINT32_C(2152038470),
    UINT32_C(2152169544),
    UINT32_C(2152300618),
    UINT32_C(2152431692),
    UINT32_C(3473462),
    UINT32_C(3604536),
    UINT32_C(2152562766),
    UINT32_C(2152693840),
    UINT32_C(2152824914),
    UINT32_C(2152955988),
    UINT32_C(3866684),
    UINT32_C(4259906),
    UINT32_C(3997758),
    UINT32_C(4128832),
    UINT32_C(2153087062),
    UINT32_C(2153218137),
    UINT32_C(2154463339),
    UINT32_C(2154922102),
    UINT32_C(4390980),
    UINT32_C(4522054),
    UINT32_C(2155315320),
    UINT32_C(2155446394),
    UINT32_C(4653128),
    UINT32_C(4784202),
    UINT32_C(2150006826),
    UINT32_C(2150400059),
    UINT32_C(2153283674),
    UINT32_C(4915276),
    UINT32_C(5046350),
    UINT32_C(5177424),
    UINT32_C(2149679138),
    UINT32_C(2150137897),
    UINT32_C(2151612497),
    UINT32_C(5374035),
    UINT32_C(2150072363),
    UINT32_C(2155610196),
    UINT32_C(5570646),
    UINT32_C(2149810238),
    UINT32_C(5701720),
    UINT32_C(5832794),
    UINT32_C(2147516452),
    UINT32_C(2151710811),
    UINT32_C(2153611390),
    UINT32_C(5963868),
    UINT32_C(2153676925),
    UINT32_C(6094942),
    UINT32_C(2151448672),
    UINT32_C(2155544671),
    UINT32_C(6291553),
    UINT32_C(6422627),
    UINT32_C(7274608),
    UINT32_C(6553701),
    UINT32_C(6750312),
    UINT32_C(2153545923),
    UINT32_C(2161115238),
    UINT32_C(2155905154),
    UINT32_C(6881386),
    UINT32_C(7012460),
    UINT32_C(2156101794),
    UINT32_C(2159575234),
    UINT32_C(2162196706),
    UINT32_C(7143534),
    UINT32_C(2157543585),
    UINT32_C(2158461100),
    UINT32_C(7405682),
    UINT32_C(8781959),
    UINT32_C(7536756),
    UINT32_C(7929978),
    UINT32_C(7667830),
    UINT32_C(7798904),
    UINT32_C(2159050929),
    UINT32_C(2159247569),
    UINT32_C(2161672409),
    UINT32_C(2162393317),
    UINT32_C(8061052),
    UINT32_C(8388737),
    UINT32_C(2162557053),
    UINT32_C(8257663),
    UINT32_C(2155970692),
    UINT32_C(2156232838),
    UINT32_C(2156429458),
    UINT32_C(8519811),
    UINT32_C(8650885),
    UINT32_C(2157609116),
    UINT32_C(2158002339),
    UINT32_C(2158264489),
    UINT32_C(2158657709),
    UINT32_C(8913033),
    UINT32_C(10092699),
    UINT32_C(9044107),
    UINT32_C(9437329),
    UINT32_C(9175181),
    UINT32_C(9306255),
    UINT32_C(2159182005),
    UINT32_C(2159640762),
    UINT32_C(2159771837),
    UINT32_C(2159968452),
    UINT32_C(9568403),
    UINT32_C(9699477),
    UINT32_C(2160492772),
    UINT32_C(2162721001),
    UINT32_C(9830551),
    UINT32_C(9961625),
    UINT32_C(2147582087),
    UINT32_C(2156494986),
    UINT32_C(2156626060),
    UINT32_C(2156757135),
    UINT32_C(10223773),
    UINT32_C(11141291),
    UINT32_C(10354847),
    UINT32_C(10748069),
    UINT32_C(10485921),
    UINT32_C(10616995),
    UINT32_C(2157150357),
    UINT32_C(2157346967),
    UINT32_C(2157478043),
    UINT32_C(2157805726),
    UINT32_C(10879143),
    UINT32_C(11010217),
    UINT32_C(2158330022),
    UINT32_C(2158526638),
    UINT32_C(2158985396),
    UINT32_C(2159444151),
    UINT32_C(11272365),
    UINT32_C(11862198),
    UINT32_C(11403439),
    UINT32_C(11534513),
    UINT32_C(2159837375),
    UINT32_C(2160427239),
    UINT32_C(2163146930),
    UINT32_C(11731124),
    UINT32_C(2148106382),
    UINT32_C(2156953745),
    UINT32_C(2157215903),
    UINT32_C(11993272),
    UINT32_C(12517568),
    UINT32_C(12124346),
    UINT32_C(12255420),
    UINT32_C(2158723278),
    UINT32_C(2161606881),
    UINT32_C(2162983149),
    UINT32_C(12386494),
    UINT32_C(2160558287),
    UINT32_C(2162852075),
    UINT32_C(12648642),
    UINT32_C(13631697),
    UINT32_C(12779716),
    UINT32_C(13172938),
    UINT32_C(12910790),
    UINT32_C(13041864),
    UINT32_C(2160099521),
    UINT32_C(2160623817),
    UINT32_C(2160754893),
    UINT32_C(2161279189),
    UINT32_C(13304012),
    UINT32_C(13435086),
    UINT32_C(2161803483),
    UINT32_C(2163114224),
    UINT32_C(2163376371),
    UINT32_C(2164195535),
    UINT32_C(2160820428),
    UINT32_C(13762771),
    UINT32_C(14680289),
    UINT32_C(13893845),
    UINT32_C(14287067),
    UINT32_C(14024919),
    UINT32_C(14155993),
    UINT32_C(2161344724),
    UINT32_C(2161541341),
    UINT32_C(2162065631),
    UINT32_C(2163310836),
    UINT32_C(14418141),
    UINT32_C(14549215),
    UINT32_C(2163572982),
    UINT32_C(2163704056),
    UINT32_C(2163900667),
    UINT32_C(2164031741),
    UINT32_C(14811363),
    UINT32_C(15663344),
    UINT32_C(14942437),
    UINT32_C(15270122),
    UINT32_C(2164130022),
    UINT32_C(15139048),
    UINT32_C(2147647491),
    UINT32_C(2147778565),
    UINT32_C(2147909639),
    UINT32_C(15401196),
    UINT32_C(15532270),
    UINT32_C(2148040715),
    UINT32_C(2148302862),
    UINT32_C(2148499472),
    UINT32_C(2148630546),
    UINT32_C(15794418),
    UINT32_C(16187640),
    UINT32_C(15925492),
    UINT32_C(16056566),
    UINT32_C(2148761620),
    UINT32_C(2148892695),
    UINT32_C(2149089305),
    UINT32_C(2149220379),
    UINT32_C(16318714),
    UINT32_C(16449788),
    UINT32_C(2149351453),
    UINT32_C(2149482527),
    UINT32_C(2155839708),
    UINT32_C(2163802365),
    UINT32_C(16646399),
    UINT32_C(2148171789),
    UINT32_C(2148958464),
};

展开全部

  • 写回答

1条回答 默认 最新

  • 神仙别闹 2021-12-30 06:05
    关注

    这个的变量定义修改下试试

    const hnode_t HuffmanCodes[]={};
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
    神仙别闹 2021-12-30 06:05

    如有帮助,采纳支持一下,谢谢。

    回复
    xengine-qyt 2022-01-14 07:37

    不得行,LINUX下可以,VC搞不到事

    回复
编辑
预览

报告相同问题?

问题事件

  • 系统已结题 1月26日
  • 已采纳回答 1月19日
  • 创建了问题 12月30日

悬赏问题

  • ¥100 有能够实现人机模式的c/c++代码,有图片背景等,能够直接进行游戏
  • ¥20 校园网认证openwrt插件
  • ¥15 以AT89C51单片机芯片为核心来制作一个简易计算器,外部由4*4矩阵键盘和一个LCD1602字符型液晶显示屏构成,内部由一块AT89C51单片机构成,通过软件编程可实现简单加减乘除。
  • ¥15 求GCMS辅导数据分析
  • ¥30 SD中的一段Unet下采样代码其中的resnet是谁跟谁进行残差连接
  • ¥15 Unet采样阶段的res_samples问题
  • ¥60 Python+pygame坦克大战游戏开发实验报告
  • ¥15 R语言regionNames()和demomap()无法选中中文地区的问题
  • ¥15 Open GL ES 的使用
  • ¥15 我如果只想表示节点的结构信息,使用GCN方法不进行训练可以吗
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部