Linux MIPS Architecture development
 help / color / mirror / Atom feed
* compile C++ code
@ 2001-08-31 10:01 kjlin
  2001-08-31 10:01 ` kjlin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: kjlin @ 2001-08-31 10:01 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]

Hi all,

My host is x86 with redhat 7.0 and install the mips cross-compiler:
1.binutils-mips-linux-2.8.1-2.i386.rpm
2.egcs-mips-linux-1.1.2-3.i386.rpm
3.egcs-c++-mips-linux-1.1.2-4.i386.rpm
4.libc-2.0.6
5.egcs-libstdc++-mips-linux-2.9.0-4.i386.rpm
But when i compile the following C++ code, something wrong!

#include <stdio.h>
class A {
public:
        A();
        virtual void hello();        // with virtual is failed, without virtual is ok.
};
A::A() {printf("A construction!\n");}
void A::hello() { printf("hello\n"); }
main()
{
        A *exam;
        exam->hello();
}

#mips-linux-gcc test.C
/usr/lib/gcc-lib/mips-linux/egcs-2.91.66/libgcc.a(frame.o): In function `decode_uleb128':
/usr/src/redhat/BUILD/egcs-1.1.2/target-mips-linux/gcc/../../gcc/frame.c(.data+0x0): undefined reference to `pthread_create'
/usr/mips-linux/bin/ld: bfd assertion fail ../../bfd/elf32-mips.c:5123
mips-linux-gcc: Internal compiler error: program ld got fatal signal 11
#mips-linux-g++ test.C
/usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_create'
/usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_getspecific'
/usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_once'
/usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_key_create'
/usr/mips-linux/lib/libstdc++.so: undefined reference to `pthread_setspecific'

If the "virtual" is not used, "virtual void hello();" to "void hello();", mips-linux-gcc compiling is fine but mips-linux-g++ compiling is still the same error.
What is going on?
Is it the problem of compiler or library?
How should i do?

Thanks in advance!
KJ



[-- Attachment #2: Type: text/html, Size: 2944 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-09-03  6:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-08-31 10:01 compile C++ code kjlin
2001-08-31 10:01 ` kjlin
2001-08-31 11:13 ` H.Heinold
2001-08-31 18:38 ` Jean-Christophe ARNU
2001-09-03  1:33   ` kjlin
2001-09-03  1:33     ` kjlin
2001-09-03  6:21     ` Brian Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox