Closed MartoniczD closed 9 years ago
I'm assuming you are using gcc4.6.3 or some version similar? There is a past issue resolved with upgrade to 4.8.2, maybe that help? https://github.com/etwmc/Personal-HomeKit-HAP-/issues/1
Wai Man Chan Sent from my iPad
On Jan 4, 2015, at 19:36, MartoniczD notifications@github.com wrote:
I'm trying to compile the static branch of the code, but I got: In file included from main.cpp:11:0: PHKNetworkIP.h:40:27: error: ISO C++ forbids initialization of member ‘index’ [-fpermissive] PHKNetworkIP.h:40:27: error: making ‘index’ static [-fpermissive] PHKNetworkIP.h:40:27: error: ISO C++ forbids in-class initialization of non-const static member ‘index’ PHKNetworkIP.h:41:18: error: ISO C++ forbids initialization of member ‘data’ [-fpermissive] PHKNetworkIP.h:41:18: error: making ‘data’ static [-fpermissive] PHKNetworkIP.h:41:18: error: invalid in-class initialization of static data member of non-integral type ‘char*’ PHKNetworkIP.h:42:27: error: ISO C++ forbids initialization of member ‘length’ [-fpermissive] PHKNetworkIP.h:42:27: error: making ‘length’ static [-fpermissive] PHKNetworkIP.h:42:27: error: ISO C++ forbids in-class initialization of non-const static member ‘length’ PHKNetworkIP.h:43:21: error: ISO C++ forbids initialization of member ‘activate’ [-fpermissive] PHKNetworkIP.h:43:21: error: making ‘activate’ static [-fpermissive] PHKNetworkIP.h:43:21: error: ISO C++ forbids in-class initialization of non-const static member ‘activate’ PHKNetworkIP.h:50:27: error: ISO C++ forbids initialization of member ‘count’ [-fpermissive] PHKNetworkIP.h:50:27: error: making ‘count’ static [-fpermissive] PHKNetworkIP.h:50:27: error: ISO C++ forbids in-class initialization of non-const static member ‘count’ PHKNetworkIP.h:88:22: error: ISO C++ forbids initialization of member ‘connected’ [-fpermissive] PHKNetworkIP.h:88:22: error: making ‘connected’ static [-fpermissive] PHKNetworkIP.h:88:22: error: ISO C++ forbids in-class initialization of non-const static member ‘connected’ PHKNetworkIP.h:92:41: error: ISO C++ forbids initialization of member ‘numberOfMsgRec’ [-fpermissive] PHKNetworkIP.h:92:41: error: making ‘numberOfMsgRec’ static [-fpermissive] PHKNetworkIP.h:92:41: error: ISO C++ forbids in-class initialization of non-const static member ‘numberOfMsgRec’ PHKNetworkIP.h:93:42: error: ISO C++ forbids initialization of member ‘numberOfMsgSend’ [-fpermissive] PHKNetworkIP.h:93:42: error: making ‘numberOfMsgSend’ static [-fpermissive] PHKNetworkIP.h:93:42: error: ISO C++ forbids in-class initialization of non-const static member ‘numberOfMsgSend’ PHKNetworkIP.h:94:22: error: ISO C++ forbids initialization of member ‘subSocket’ [-fpermissive] PHKNetworkIP.h:94:22: error: making ‘subSocket’ static [-fpermissive] PHKNetworkIP.h:94:22: error: ISO C++ forbids in-class initialization of non-const static member ‘subSocket’
What am I doing wrong?
— Reply to this email directly or view it on GitHub.
Thank you! By updating the g++ from 4.6.3 to 4.9.X solved the problem. I will try to port your great code to STM32.
Given what I gather from IAR workbench, this will be hard to find the replacement for middle layer, i.e. sys/types, etc. (At least for the 8051 in CC2541)
I'm trying to compile the static branch of the code, but I got: In file included from main.cpp:11:0: PHKNetworkIP.h:40:27: error: ISO C++ forbids initialization of member ‘index’ [-fpermissive] PHKNetworkIP.h:40:27: error: making ‘index’ static [-fpermissive] PHKNetworkIP.h:40:27: error: ISO C++ forbids in-class initialization of non-const static member ‘index’ PHKNetworkIP.h:41:18: error: ISO C++ forbids initialization of member ‘data’ [-fpermissive] PHKNetworkIP.h:41:18: error: making ‘data’ static [-fpermissive] PHKNetworkIP.h:41:18: error: invalid in-class initialization of static data member of non-integral type ‘char*’ PHKNetworkIP.h:42:27: error: ISO C++ forbids initialization of member ‘length’ [-fpermissive] PHKNetworkIP.h:42:27: error: making ‘length’ static [-fpermissive] PHKNetworkIP.h:42:27: error: ISO C++ forbids in-class initialization of non-const static member ‘length’ PHKNetworkIP.h:43:21: error: ISO C++ forbids initialization of member ‘activate’ [-fpermissive] PHKNetworkIP.h:43:21: error: making ‘activate’ static [-fpermissive] PHKNetworkIP.h:43:21: error: ISO C++ forbids in-class initialization of non-const static member ‘activate’ PHKNetworkIP.h:50:27: error: ISO C++ forbids initialization of member ‘count’ [-fpermissive] PHKNetworkIP.h:50:27: error: making ‘count’ static [-fpermissive] PHKNetworkIP.h:50:27: error: ISO C++ forbids in-class initialization of non-const static member ‘count’ PHKNetworkIP.h:88:22: error: ISO C++ forbids initialization of member ‘connected’ [-fpermissive] PHKNetworkIP.h:88:22: error: making ‘connected’ static [-fpermissive] PHKNetworkIP.h:88:22: error: ISO C++ forbids in-class initialization of non-const static member ‘connected’ PHKNetworkIP.h:92:41: error: ISO C++ forbids initialization of member ‘numberOfMsgRec’ [-fpermissive] PHKNetworkIP.h:92:41: error: making ‘numberOfMsgRec’ static [-fpermissive] PHKNetworkIP.h:92:41: error: ISO C++ forbids in-class initialization of non-const static member ‘numberOfMsgRec’ PHKNetworkIP.h:93:42: error: ISO C++ forbids initialization of member ‘numberOfMsgSend’ [-fpermissive] PHKNetworkIP.h:93:42: error: making ‘numberOfMsgSend’ static [-fpermissive] PHKNetworkIP.h:93:42: error: ISO C++ forbids in-class initialization of non-const static member ‘numberOfMsgSend’ PHKNetworkIP.h:94:22: error: ISO C++ forbids initialization of member ‘subSocket’ [-fpermissive] PHKNetworkIP.h:94:22: error: making ‘subSocket’ static [-fpermissive] PHKNetworkIP.h:94:22: error: ISO C++ forbids in-class initialization of non-const static member ‘subSocket’
What am I doing wrong?