Problems compiling SWT apps using Mohans instructions

Erik Poupaert erik.poupaert@chello.be
Mon Feb 17 18:00:00 GMT 2003


>>>> I tried Mohans GCJ at my clients and I got the error messages
>>>> below. No idea if this is GCJ or the SWT build included in
>>>> your package.
...
>>>>>>[apply] c:\temp/ccqMbaaa.o(.text+0xd434d): In function
`ZN3com5cyviz3gui9ComboItemC1EPN3org7eclipse3swt7widgets9CompositeEPN4java4l
ang6StringEPNS0_7blender5value10ComboModelE':


I used to have these seemingly unjustified linker errors all the time. With
3.2 sometimes, and even more often with 3.3.

Sometimes "Ant clean" helps. What really did the trick for me, however, was
to ask the linker to search libraries multiple times. Typically, I have ant
files that do:

	 <exec executable="gcj">
		 <arg line="-mwindows -s res/*.o  -Xlinker --start-group x1.a x2.a
x3.a -Xlinker --end-group -o myexe --main=MainClass"/>
           </exec>

Note that this probably requires you to create archives from you application
*.o files, prior to linking them:

        <apply failonerror="true" executable="ar" parallel="true">
            <fileset dir="obj/*" includes="**/*.o"/>
            <arg line="-cr x1.a"/>
       </apply>



More information about the Java mailing list