On 2 June 2006 at 1:34, "Gregory Shimansky" <[EMAIL PROTECTED]> wrote:
>
> [ lots of cool stuff about compiling with MS tool chain snipped ]
> 
> I also tried gcc -mno-cygwin with little success. One lesson
> learned is that sources should be compiled with -DWINVER=0x501 and
> the compilation succeds.  But I have troubles with linking and I
> just don't have any idea what to do with *.def and *.rc files in
> cygwin/mingw environment. Any ideas?

I tried using mingw directly a while back - but decided to give up until
we'd split the natives.  It should be similar to "gcc -mno-cygwin" but
things just seemed to proceed far more smoothly.

For .rc files, I used a rule like:

  %.res.obj: %.rc
          windres --include-dir ../include -i $< -o $@

to create .obj files from the .rc files.  (I think that's the right
thing to do but since I never actually got it working ... )

As for .def files,  I think these can be generated by the linker - and
we want .lib files created too I think.  You can pass linker options
from the dll build rule with the -Wl,... option something 
like:

$(DLLNAME): $(BUILDFILES) $(VIRTFILES) $(MDLLIBFILES)
  $(CC) -shared -o $@ \
  -Wl,--output-def,[EMAIL PROTECTED]:.dll=.def},--out-implib,$(LIBPATH)[EMAIL 
PROTECTED]:.dll=.lib} \
  $(BUILDFILES) $(VIRTFILES) $(MDLLIBFILES) $(SYSLIBFILES) \
  -lkernel32  -lws2_32 -ladvapi32 -luser32 -lgdi32 -lcomdlg32 -lwinspool

HTH,
 Mark.



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to