Skip to content

Commit d12822f

Browse files
author
Deepika
committed
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.
1 parent 7d98eeb commit d12822f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

targets/TARGET_Realtek/TARGET_AMEBA/rtw_emac.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ emac_interface_t *wlan_emac_init_interface()
217217
{
218218

219219
if (_emac == NULL) {
220-
_emac = new emac_interface_t();
220+
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t));
221221
if (_emac == NULL) {//new emac_interface_t fail
222222
printf("emac initialization failed\r\n");
223223
return NULL;

0 commit comments

Comments
 (0)