gcc -o Foo Foo.java Doesn't Produce Foo
Andrew Haley
aph@redhat.com
Thu Jul 17 11:36:00 GMT 2008
Eus wrote:
> Hi Ho!
>
> --- On Wed, 7/9/08, "David Daney" <ddaney@avtrex.com> wrote:
>
>> Do you have libgcj.a installed? Probably you will want to use -static-libgcj instead of --static.
>>
>> Also be forewarned that static linking with gcj is very tricky. You might want to read the Wiki:
>>
>> http://gcc.gnu.org/wiki/Statically_linking_libgcj
>
> I have followed the instruction on the site under "For versions of GCJ before 4.2" because `ls /usr/lib/libgcj*' returned libgcj with version 4.0.0.
> All steps are okay but the last one:
>
> gcc -o Foo Foo.o Foomain.i -shared-libgcc -Wl,-non_shared -lgcj -Wl,-call_shared -lsupc++ -Wl,--as-needed -lz -lgcc_s -lpthread -lc -lm -ldl -Wl,--no-as-needed
>
> It does not produce `Foo' even after I have tried the command several times. I also have tried `-o ./Foo' but to no avail.
>
> Do you have any suggestion on how I should attack this problem?
First, make sure you can create a dynamically linked executable.
If that doesn't work either, tell us.
Andrew.
More information about the Gcc-help
mailing list