gpt4 book ai didi

c++ - 使用GCC 4.8 : array used as initializer构建错误

转载 作者:行者123 更新时间:2023-12-02 11:14:32 26 4
gpt4 key购买 nike

在SUSE上使用gcc 4.8出现以下错误:

有谁知道此错误的根源以及如何解决该错误?

我回来的更多细节:

参加以下类(class)

smoquery.h 

class SmoQuery
{
public:
SmoQuery(SqlLogonElem * const & eLogon,
optionsInfo_t * const & optionsInfoP,
logicalNameList_t * const & pRequestedDbList,
logicalNameList_t * const & pExcludeDbList,
SqlDatabaseElem * const & peDatabase,
dsBool_t const bIncludeFrontEndCapacity,
dsBool_t const bReplacementChars);

~SmoQuery();

private:
Options mOptions;

char optionsFilePath[PATH_MAX+1] = "";
};


smoquery.cpp

SmoQuery::SmoQuery(SqlLogonElem * const & eLogon,
optionsInfo_t * const & optionsInfoP,
logicalNameList_t * const & pRequestedDbList,
logicalNameList_t * const & pExcludeDbList,
SqlDatabaseElem * const & peDatabase,
dsBool_t const bIncludeFrontEndCapacity,
/*line 80 --->*/ dsBool_t const bReplacementChars)
{
/* all code was commented */
}

构建日志说:

Gmake构建...(包括已在此评论中删除的内容)
g++ -D_LINUX -D_LINUX64 -DLINUX64 -D_LINUXAMD64 -DMBCS_AIX -D_THREADS -D_CPP_ALL -DNO_CDE -D_LONG_LONG -D_LARGEFILE64_SOURCE -DWIDE_CHAR_FIX -DDSMAPILIB -DDSM_STANDALONE_PROGRAM -DUNIX -D_FILE_OFFSET_BITS=64 -D_NEED_USING_NAMESPACE -D_GNU_SOURCE -DSQL -O -I. -I.. .... -fpermissive -fpic -fstack-protector -Wall -Wno-write-strings -Wno-missing-braces -DBUILD_TSM_V816 -std=c++11 -c smoquery.cpp -o ../../sqlonlinux/optimized/obj816/linuxAMD64/smoquery.o

...

smoquery.cpp: In constructor ‘SmoQuery::SmoQuery(SqlLogonElem* const&, optionsInfo_t* const&, logicalNameList_t* const&, logicalNameList_t* const&, SqlDatabaseElem* const&, dsBool_t, dsBool_t)’:
smoquery.cpp:132:72: error: array used as initializer
dsBool_t const bReplacementChars)
^
In file included from smoquery.cpp:80:0:

最佳答案

麻烦的是此成员的初始化

char optionsFilePath [PATH_MAX + 1] =“”;

gcc 4.8(我使用的)误导了麻烦线(那个尖号^符号)。

任何人都可以提交错误吗?

关于c++ - 使用GCC 4.8 : array used as initializer构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50025430/

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