libstdc++ linking problem
William A. Gatliff
Wed May 1 05:13:00 GMT 2002
Add a "using namespace std;" to the top of your test.cc.
On Wed, May 01, 2002 at 11:07:46AM +0530, S Sathyanarayanan wrote:
> I am not able to successfully link my helloworld program(test.cc) using
> mips-elf-ld. I'm using mips-elf-g++ for compile.
> The gcc build was successfull with newlib.
> The linker is not able to link the *.o files in the archive file(stdc++)
> I have tried the -lstdc++ -L<dir>, but the linker is not able to get
> definitions from libstdc++. Also, i have tried with libgcc.a and libc.a
> The following error is got,
> mips-elf-g++ -c -EB -I/home/sathyas/yamon_appl/include -DEB -o test.o test.cc
> mips-elf-g++ -c -EB -I/home/sathyas/yamon_appl/include -DEB -o start.o start.S
> mips-elf-ld -T ./link.xn -o appl.elf -Map appl.map test.o start.o
> test.o: In function `main':
> test.cc(.text+0x18): undefined reference to `cout'
> test.cc(.text+0x1c): undefined reference to `cout'
> test.cc(.text+0x24): undefined reference to `ostream::operator<<(char
> const *)'
> make: *** [appl.elf] Error 1
> test.cc -sample program
> start.S -start up code for MIPS Malta board
> link.xn - Linker script
> Please suggest or clarify what is going wrong, I have also set the
> environment variables LD_LIBRARY_PATH and GCC_EXEC_PREFIX
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to email@example.com
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to firstname.lastname@example.org
More information about the crossgcc