#76 Fixes for MinGW DLL compilation

open
None
5
2012-08-15
2008-03-14
Carlo Bramini
No

I think that the creation of LibMNG DLL and its import library need some fixes:

1) Into the sources, you must add MNG_EXT to all functions that you want to be exported (just putting it on the prototypes into libmng.h is not sufficient).

2) Into makefile/makefile.mingwdll, add this option to LDFLAGS:

-Wl,--add-stdcall-alias

This will allow some software (like XINE) to detect if libmng is installed at configure time.

3) Into makefile/makefile.mingwdll, Remove the "-lmng" from LDFLAGS.

4) After all previous changes, the DLL can be built with:
$(LIBMNG_DLL) : $(OBJS)
gcc -shared $^ -o $@ -Wl,--out-implib,$(LIBMNG_A) $(LDFLAGS)

I hope you will find it helpful.

Sincerely,

Carlo Bramini.

Discussion

  • Logged In: YES
    user_id=7859
    Originator: NO

    3) Into makefile/makefile.mingwdll, Remove the "-lmng" from LDFLAGS

    What about "-lm"?

    Glenn

     
  • Carlo Bramini
    Carlo Bramini
    2008-04-21

    Logged In: YES
    user_id=1386839
    Originator: YES

    I removed "-lm" as you suggested me and it still compiles & link fine.
    I also removed "-s" from CFLAGS, since this option is used only when linking (LDFLAGS still provides it).

    Sincerely,

    Carlo Bramini

     


Anonymous


Cancel   Add attachments