Qt 发布程序时出错 Debug时没有错误 Release时出现错误 20
typedefstructtag{unsignedshortintgroup;unsignedshortintelement;charvr[3];unsignedintl...
typedef struct tag
{
unsigned short int group;
unsigned short int element;
char vr[3];
unsigned int length;
char *vf;
}TAG;
TAG file_meta_info[K] = {
{ 0x0002, 0x0000, "UL", 4, (char *)&glen },
{ 0x0002, 0x0001, "OB", 2, "01" },
{ 0x0002, 0x0002, "UI", 0, NULL },
{ 0x0002, 0x0003, "UI", 0, NULL },
{ 0x0002, 0x0010, "UI", 0, NULL },
{ 0x0002, 0x0012, "UI", 0, NULL },
{ 0x0002, 0x0013, "SH", 0, NULL } };
显示出错在最后一行,不过把最后一行注释掉之后仍然出错,而且还在最后一行。
error: C2440: 'initializing' : cannot convert from 'const char [3]' to 'char *'
Conversion from string literal loses const qualifier (see /Zc:strictStrings) 展开
{
unsigned short int group;
unsigned short int element;
char vr[3];
unsigned int length;
char *vf;
}TAG;
TAG file_meta_info[K] = {
{ 0x0002, 0x0000, "UL", 4, (char *)&glen },
{ 0x0002, 0x0001, "OB", 2, "01" },
{ 0x0002, 0x0002, "UI", 0, NULL },
{ 0x0002, 0x0003, "UI", 0, NULL },
{ 0x0002, 0x0010, "UI", 0, NULL },
{ 0x0002, 0x0012, "UI", 0, NULL },
{ 0x0002, 0x0013, "SH", 0, NULL } };
显示出错在最后一行,不过把最后一行注释掉之后仍然出错,而且还在最后一行。
error: C2440: 'initializing' : cannot convert from 'const char [3]' to 'char *'
Conversion from string literal loses const qualifier (see /Zc:strictStrings) 展开
2018-04-04
展开全部
在QMAKE_CXXFLAGS_RELEASE += -Zc:strictStrings-
添加这个选项,就可以了
添加这个选项,就可以了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询