问答

汇集网友智慧,解决技术难题

PIC32MZ

TA的家园币:10  

  • XC32对于const数组编译问题

    typedefstruct{unsignedcharInd[2];charMss[32];}typFNT_GB16;consttypFNT_GB16tfont16[]={"深",0x00,0x00,0x27,0xFC,0x14,0x04,0x14,0xA4,0x81,0x10,0x42,0x08,0x40,0x40,0x10,0x40,0x17,0xFC,0x20,0x40,0xE0,0xE0,0x21,0x50,0x22,0x48,0x2C,0x46,0x20,0x40,0x00,0x40,/*0*/};上面这个数组,XC16编译器可以编译通过。没有问题。XC32编译器编译不能通过。开发环境MPLABXIDE5.45.XC32:2.50使用harmony3.XC32提示如下:Infileincludedfrom../src/myCode/lcd/gui.c:4:0:../src/myCode/lcd/font.h:217:5:error:missingbracesaroundinitializer[-Werror=missing-braces]{"??",0x00,0x00,0x27,0xFC,0x14,0x04,0x14,0xA4,0x81,0x10,0x42,0x08,0x40,0x40,0x10,0x40,nbproject/Makefile-default.mk:370:recipefortarget'build/default/production/_ext/1784247729/gui.o'failed^make[2]:Leavingdirectory'D:/1111/FWS/KEY5/KEY5_LCD/V6_PIC32MZ/CODE/PIC32_H/firmware/PIC32MZ.X'../src/myCode/lcd/font.h:217:5:error:(nearinitializationfor'tfont16[0].Msk')[-Werror=missing-braces]cc1.exe:allwarningsbeingtreatedaserrorsnbproject/Makefile-default.mk:91:recipefortarget'.build-conf'failedmake[2]:***Error255make[1]:Leavingdirectory'D:/1111/FWS/KEY5/KEY5_LCD/V6_PIC32MZ/CODE/PIC32_H/firmware/PIC32MZ.X'make[1]:***[.build-conf]Error2nbproject/Makefile-impl.mk:39:recipefortarget'.build-impl'failedmake:***[.build-impl]Error2BUILDFAILED(exitvalue2,totaltime:6s)百度了一下,error:missingbracesaroundinitializer加了大括号。consttypFNT_GB16tfont16[]={{"深",0x00,0x00,0x27,0xFC,0x14,0x04,0x14,0xA4,0x81,0x10,0x42,0x08,0x40,0x40,0x10,0x40,0x17,0xFC,0x20,0x40,0xE0,0xE0,0x21,0x50,0x22,0x48,0x2C,0x46,0x20,0x40,0x00,0x40,/*0*/}};还是不行,编译不通过。哪位大神可以指导一下,这是什么原

    编译 ui TI pi

    2021-03-05 1