mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] MXE: How to build a self-sufficient DLL that


From: Matthias Geier
Subject: Re: [Mingw-cross-env-list] MXE: How to build a self-sufficient DLL that statically includes other libraries?
Date: Mon, 30 Mar 2015 17:39:00 +0200

On Mon, Mar 30, 2015 at 5:03 PM, JohnD wrote:
>
>> From: Matthias Geier
>> Sent: Monday, March 30, 2015 10:35 AM
>> To: John Donoghue
>> Cc: address@hidden
>> Subject: Re: [Mingw-cross-env-list] MXE: How to build a self-sufficient DLL 
>> that
>> statically includes other libraries?
>>
>> On Fri, Mar 27, 2015 at 11:37 AM, John Donoghue wrote:
>> > Wouldnt using tools/make-shared-from-static to create shared libs work?
>>
>> Thanks for the hint!
>> To be honest, I wasn't aware of the tools/ directory at all!
>>
>> Is there any documentation for how to use this?
>>
>> I came that far:
>>
>> $ tools/make-shared-from-static --ar ar --ld ld usr/x86_64-w64-
>> mingw32.static/lib/libsndfile.a -lFLAC
>>
>> This leads to a lot of linker errors, among others regarding lrint, strlen, 
>> memset,
>> calloc ...
>>
>> What other options am I supposed to use?
>>
>> cheers,
>> Matthias
>
> Take a look at the mxe main Makefile which defines a variable 
> MAKE_SHARED_FROM_STATIC
> Ar, ld etc will need to be the cross compiled target versions, there also 
> options for the lib and bin path

Ah, OK, thanks.

Now I'm using this:

export PATH=$(pwd)"/usr/bin:$PATH"
tools/make-shared-from-static --windowsdll --ar
x86_64-w64-mingw32.static-ar --ld x86_64-w64-mingw32.static-ld
--libdir usr/x86_64-w64-mingw32.static/lib --bindir
usr/x86_64-w64-mingw32.static/bin
usr/x86_64-w64-mingw32.static/lib/libsndfile.a

... and I get this output:

+ x86_64-w64-mingw32.static-ld -shared -Wl,--export-all-symbols
-Wl,--enable-auto-import -Wl,--enable-auto-image-base add.o aiff.o
alaw.o audio_detect.o au.o avr.o broadcast.o caf.o chanmap.o chunk.o
code.o command.o common.o decode.o dither.o double64.o dwd.o dwvw.o
file_io.o flac.o float32.o g721.o g723_16.o g723_24.o g723_40.o g72x.o
gsm610.o gsm_create.o gsm_decode.o gsm_destroy.o gsm_encode.o
gsm_option.o htk.o id3.o ima_adpcm.o ima_oki_adpcm.o interleave.o
ircam.o long_term.o lpc.o lt1-g72x.o macbinary3.o macos.o mat4.o
mat5.o mpc2k.o ms_adpcm.o nist.o ogg.o ogg_pcm.o ogg_speex.o
ogg_vorbis.o paf.o pcm.o preprocess.o pvf.o raw.o rf64.o rpe.o rx2.o
sd2.o sds.o short_term.o sndfile.o strings.o svx.o table.o txw.o
ulaw.o version-metadata.o voc.o vox_adpcm.o w64.o wav.o wav_w64.o
windows.o wve.o xi.o -Wl,--out-implib=libsndfile.dll.a -o
libsndfile.dll -Lusr/x86_64-w64-mingw32.static/lib
x86_64-w64-mingw32.static-ld: unrecognized option '-Wl,--export-all-symbols'
x86_64-w64-mingw32.static-ld: use the --help option for usage information

This looks a bit strange, because of the "-Wl," stuff, which should be
removed before passing the options to the linker (as far as I know).
If I remove them manually, however, I get more errors because the
o-files cannot be found:

x86_64-w64-mingw32.static-ld: cannot find add.o: No such file or directory
x86_64-w64-mingw32.static-ld: cannot find aiff.o: No such file or directory

Do I have to use --install?
If yes, how exactly?

What else am I missing?

cheers,
Matthias



reply via email to

[Prev in Thread] Current Thread [Next in Thread]