public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Keith <keith@rhsdplanning.com>
To: Andrew Haley <aph@redhat.com>
Cc: java@gcc.gnu.org
Subject: Re: link error: undefined reference
Date: Thu, 01 Apr 2010 20:08:00 -0000	[thread overview]
Message-ID: <4BB4FD0A.3030105@rhsdplanning.com> (raw)
In-Reply-To: <4BB2FDDB.4000405@redhat.com>

Thank you very much. I feel like an idiot. Obviously I've been away from 
gcc too long and forgot to keep my compile flags consistent.

Just FYI, compiling under Windows XP, SP3, using gcj 4.4.0, mingw, and msys

When I compile with -O0 -m32 -fjni -findirect-dispatch
using gcj 4.4.0, I get
gcj: unrecognized option '-s-bc-abi'
for some files. It seems to do no harm.

$ cat Test.java
class Test {
    public static void main(String[] args)
    {
        System.out.println("Sample message");
    }
}

$ sh -x make-test.sh
+ C_FLAGS='-O0 -m32 -findirect-dispatch'
+ gcj -O0 -m32 -findirect-dispatch -C Test.java
gcj.exe: unrecognized option '-s-bc-abi'
+ gcj -O0 -m32 -findirect-dispatch -o Test.exe Test.class --main=Test 
-Wl,--enable-auto-import

$ ./Test.exe
Simple message


$ sh -x make-test.sh
+ C_FLAGS='-O0 -m32'
+ gcj -O0 -m32 -C Test.java
+ gcj -O0 -m32 -o Test.exe Test.class --main=Test -Wl,--enable-auto-import

$ ./Test.exe

This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.


Andrew Haley wrote:
> On 30/03/10 19:27, Keith wrote:
>   
>> Environment is Windows XP, gcj 4.4.0, compiling under MSYS
>> The final error I have is:
>>
>> C:\DOCUME~1\Keith\LOCALS~1\Temp\ccXVrvPx.o:cc8hZGFd.i:(.text+0x29):
>> undefined reference to `com::performanceplanningsystem::ui::PPS::class$'
>> collect2: ld returned 1 exit status
>>     
>
> This is because you're mixing -findirect-dispatch and
> -fno-indirect-dispatch, which doesn't work.  Compile the executable
> with -findirect-dispatch too.
>
> Andrew.
>
>
>   

  reply	other threads:[~2010-04-01 20:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 18:08 'java.lang.String' has no method Keith
2010-03-25 18:26 ` Andrew Haley
2010-03-26 16:51 ` Keith
2010-03-26 16:55   ` Andrew John Hughes
2010-03-30 18:27     ` link error: undefined reference Keith
2010-03-31  7:46       ` Andrew Haley
2010-04-01 20:08         ` Keith [this message]
2010-04-02  8:47           ` Andrew Haley
     [not found]     ` <4BB23C24.3030103@rhsdplanning.com>
2010-03-30 18:31       ` 'java.lang.String' has no method Andrew John Hughes
2010-03-30 18:41     ` Keith

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=4BB4FD0A.3030105@rhsdplanning.com \
    --to=keith@rhsdplanning.com \
    --cc=aph@redhat.com \
    --cc=java@gcc.gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).