Alexander Chemeris
2007-Dec-03 19:58 UTC
[Speex-dev] [PATCH] Add Visual Studio 2008 Prject files
On 12/3/07, Erik de Castro Lopo <mle+la@mega-nerd.com> wrote:> I just checked and there is nothing needed in configure.ac. > > In the Makefile.am that creates the shared library you need to add > "-no-undefined" to the LDFLAGS variable like this: > > libspeex_la_LDFLAGS = -no-undefined @WHATEVER_WAS_THERE_BEFORE@Which symbols will it export? I think default behaviour would be to export all symbols, which is not good. So, is there way to pass *.def file to it? -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
Erik de Castro Lopo
2007-Dec-04 10:14 UTC
[Speex-dev] [PATCH] Add Visual Studio 2008 Prject files
Alexander Chemeris wrote:> Which symbols will it export? I think default behaviour would be to export > all symbols, which is not good. So, is there way to pass *.def file to it?Thats actually something you really should do. Have a look at the way libsndfile does it: http://www.mega-nerd.com/libsndfile/ Erik -- ----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "You'll never go broke underestimating the intelligence of the American public." -- P.T. Barnum
Mikael Magnusson
2007-Dec-04 14:00 UTC
[Speex-dev] [PATCH] Add Visual Studio 2008 Prject files
Alexander Chemeris wrote:> On 12/3/07, Erik de Castro Lopo <mle+la@mega-nerd.com> wrote: >> I just checked and there is nothing needed in configure.ac. >> >> In the Makefile.am that creates the shared library you need to add >> "-no-undefined" to the LDFLAGS variable like this: >> >> libspeex_la_LDFLAGS = -no-undefined @WHATEVER_WAS_THERE_BEFORE@ > > Which symbols will it export? I think default behaviour would be to export > all symbols, which is not good. So, is there way to pass *.def file to it? >Yes, you can add a DEF file to the linker arguments to select the symbols to export (-Wl,$(srcdir)/speex.def). Another method is using function attributes, __declspec(dllexport) or __attribute__ ((dllexport)). But if you want to reduce the number of exported symbols on other platforms as well, you need to use libtools `-export-symbols SYMFILE' or `-export-symbols-regex REGEX'. Mikael
Alexander Chemeris
2007-Dec-05 17:00 UTC
[Speex-dev] [PATCH] Add Visual Studio 2008 Prject files
On 12/4/07, Mikael Magnusson <mikma264@gmail.com> wrote:> Yes, you can add a DEF file to the linker arguments to select the > symbols to export (-Wl,$(srcdir)/speex.def).Could you add this to your patch for MinGW? libspeex.def and libspeexdsp.def are in $(srcdir)/win32/ dir. It would be a good thing to do.> Another method is using function attributes, __declspec(dllexport) or > __attribute__ ((dllexport)).This is a bad behaviour, as you have to distinguish beween dll imported and static lib imported symbols in user program. That is you could not just replace dll-import libspeex.lib with static libspeex.lib - you will also need to change included .h files (or add appropriate define). Not a big trouble, but make things less resistant to human errors. -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000