Resolved compiler error: constructor deleted

IAR 8.x compiler throws error for emac_interface_t constructor
rtw_emac.cpp@220,0: [Pe1790]: the default constructor of "emac_interface"
cannot be referenced -- it is a deleted function

Error is because new object is created of structure with constant member.
Resolved it by using malloc instead new.
pull/4938/head
Deepika 2017-08-30 10:46:16 -05:00
parent 7d98eebf2a
commit d12822f95a
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ emac_interface_t *wlan_emac_init_interface()
{
if (_emac == NULL) {
_emac = new emac_interface_t();
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
if (_emac == NULL) {//new emac_interface_t fail
printf("emac initialization failed\r\n");
return NULL;