All of lore.kernel.org
 help / color / mirror / Atom feed
From: "kjlin" <kj.lin@viditec-netmedia.com.tw>
To: <linux-mips@oss.sgi.com>
Subject: compile C++ code
Date: Fri, 31 Aug 2001 18:01:51 +0800	[thread overview]
Message-ID: <02b801c13203$f52ad440$056aaac0@kjlin> (raw)

[-- 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 --]

WARNING: multiple messages have this Message-ID (diff)
From: "kjlin" <kj.lin@viditec-netmedia.com.tw>
To: linux-mips@oss.sgi.com
Subject: compile C++ code
Date: Fri, 31 Aug 2001 18:01:51 +0800	[thread overview]
Message-ID: <02b801c13203$f52ad440$056aaac0@kjlin> (raw)
Message-ID: <20010831100151.lL8vQ4qyfDbmRhQcq4RdSQLV_GUicKb8CAxHSF-l0bw@z> (raw)

[-- 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 --]

             reply	other threads:[~2001-08-31 10:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-31 10:01 kjlin [this message]
2001-08-31 10:01 ` compile C++ code 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='02b801c13203$f52ad440$056aaac0@kjlin' \
    --to=kj.lin@viditec-netmedia.com.tw \
    --cc=linux-mips@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.