Some Questions about C++ Features
Reinhard
Posts: 489
Hi,
I try the C++ Features, and something works well.
I think with Classes and Instances it is similar to handle like SPIN Objects.
2 Questions remain: errors below I get if I uncomment the parts in the attached source files.
using of Destructor :
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccwYPCvm.o: In function `_main':
(.text+0x1c): undefined reference to `___gxx_personality_sj0'
collect2: ld returned 1 exit status
using of new :
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `_main':
(.text+0x1c): undefined reference to `___gxx_personality_sj0'
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `_main':
(.text+0x1d0): undefined reference to `operator new(unsigned int)'
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `.L4':
(.text+0x254): undefined reference to `operator delete(void*)'
collect2: ld returned 1 exit status
Maybe I make some wrong ?
best regards
Reinhard
I try the C++ Features, and something works well.
I think with Classes and Instances it is similar to handle like SPIN Objects.
2 Questions remain: errors below I get if I uncomment the parts in the attached source files.
using of Destructor :
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccwYPCvm.o: In function `_main':
(.text+0x1c): undefined reference to `___gxx_personality_sj0'
collect2: ld returned 1 exit status
using of new :
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `_main':
(.text+0x1c): undefined reference to `___gxx_personality_sj0'
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `_main':
(.text+0x1d0): undefined reference to `operator new(unsigned int)'
/cygdrive/c/DOKUME~1/Reinhard/LOKALE~1/Temp/ccGVPYxQ.o: In function `.L4':
(.text+0x254): undefined reference to `operator delete(void*)'
collect2: ld returned 1 exit status
Maybe I make some wrong ?
best regards
Reinhard
Comments
Unfortunately there is currently a build issue in libstdc++, so it wasn't in the initial alpha release. I hope we'll have it working soon.
Eric
Ohh, yes I see
Thanks for quick response
\myC\propeller_chip\gcc\C++>mk
\myC\propeller_chip\gcc\C++>propeller-elf-g++ -mlmm -o SquareWaveGenerator.o -c SquareWaveGenerator.cpp
\myC\propeller_chip\gcc\C++>pause
Dr
"new" and "delete" require malloc/free, which I've not seen implemented on any embedded systems. I'd limit my use to statically-defined objects.
[DISCLAIMER]I've never used propgcc; I've only tried to avoid libstdc++ on small c++ programs on x86.[/DISCLAIMER]
___gxx_personality_sj0 is referenced by C++ programs, even if no libstdc++ features are ever used. If you could include a dummy library that defines that, or define it in the linker script, until libstdc++ works, that would be quite helpful.
Thanks for the tips. We have libstdc++ building now, but it is extremely large, so it'd probably be useful to have a dummy libstdc++ that people can choose to link with for minimal C++ programs.
Eric
Welcome to the forums.