Can I use “new” operator?
Can I use “new” operator?
Hello.
My simple sample source code shows build error.
KPIT GNURL78-ELP Toolchain v4.9.2.201701.
int main(void)
{
char *p = new char[8];
while (1) {}
return 0;
}
Above code makes the following (linker) errors.
undefined reference to `_bsssize’
undefined reference to `_bssstart’
undefined reference to `_datastart’
undefined reference to `_fini_array_end’
undefined reference to `_fini_array_start’
undefined reference to `_init_array_end’
undefined reference to `_init_array_start’
undefined reference to `_preinit_array_end’
undefined reference to `_preinit_array_start’
undefined reference to `_romdatastart’
undefined reference to `_romsaddrcopysize’
undefined reference to `_romsaddrstart’
undefined reference to `_saddrstart’
undefined reference to `_stack’
Are something special settings required for uising “new” operator?
Hello,
Thank you for reaching out to us.
Unfortunately, based on the information provided, we can’t reproduce the issue with a sample project using the GNURL78-ELF Toolchain v4.9.2.201701. Could you please confirm if you use e2studio for project building or command line?
Also, could you please send us your entire project? Or if that is not possible and you are using e2studio we would greatly appreciate if you could send us the entire build log, the map file and the linker script used.
Thank you, we look forward to hearing back from you soon.
Best regards,
The GNU Tools Team
Hello.
A “new” issue was solved.
The issue project was built completely by changing following settings.
“Tool Settings / Library Generator”
Type : Project-Built –> PreBuilt
Selent : Newlib –> Optimized
Thank you.
nishi-tk