--- Quote Start ---
originally posted by klocken+oct 17 2006, 08:24 pm--><div class='quotetop'>quote (klocken @ oct 17 2006, 08:24 pm)</div>
--- quote start ---
<!--quotebegin-mike desimone@Oct 5 2005, 12:22 PM
actually, ecos supports stl just fine; this is a function of gcc and not ecos. it's just that the "-nostdlib" flag makes it not link the standard c++ library by default.
you need to add the "-lstdc++" flag to your link command, and it needs to be after all your .o files and any other libraries that use the stl.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10180)
--- quote end ---
--- Quote End ---
I have the same problem, and the -lstdc++ makes no difference. See below:
make INSTALL_DIR=c:/Development/DefectAnalyzer/eCos/DspFull_Install all
nios2-elf-gcc -nostartfiles -Lc:/Development/DefectAnalyzer/eCos/DspFull_Install/lib -Ttarget.ld -g -lstdc++ -Wl,--gc-sections -Wl,-static -mhw-mul -mhw-mulx -mno-hw-div -o hello hello.o
hello.o(.gnu.linkonce.t._ZN9ExceptionD1Ev+0x68): In function `main':
/cygdrive/c/altera/kits/nios2_60/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../../include/c++/3.4.1/bits/basic_string.h:178: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
hello.o(.gnu.linkonce.t._ZN9ExceptionD1Ev+0x6c): In function `main':
/cygdrive/c/Development/DefectAnalyzer/eCosProjects/examples/hello.cpp:30: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage'
[etc.]
Any ideas about what to try next?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18759)</div>
[/b]
--- Quote End ---
It looks like you didn't put the -lstdc++ after all the .o files that use the std C++
library. It needs to be the last thing on the line. So, for example, you might see
something like this in your makefile:
@$(XLD) $(LDFLAGS) $(ECOS_GLOBAL_LDFLAGS) -o $@ $(OBJS) -lstdc++