bugThe FreeType Project - Bugs: bug #53969, "multiple definition of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #53969: "multiple definition of `FT_XXX' ... first defined here"

Submitter:  Reino Wijnsma <reino>
Submitted:  Thu 24 May 2018 01:02:21 PM UTC
   
 
Severity:  3 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  podtelez Open/Closed:  Closed
Planned Release:  2.10.0

Jump to the original submission

Mon 13 Aug 2018 05:12:29 AM UTC, comment #22: 

Thanks for checking.

And yes, it's normal that we are closing bugs as soon as someone confirms that it works.  We also close bugs if we are sure that we've fixed it, not waiting for confirmation.

Far too many issues are reported here that don't get any follow-ups from the OP.  It's easy to re-open bugs if necessary.

Werner LEMBERG <wl>
Group administrator
Sun 12 Aug 2018 01:15:18 PM UTC, comment #21: 

Hmm. I don't know if this is normal procedure around here, but I find it very strange to close a bug-discussion upon anyone other then the original poster's confirmation that the bug has been fixed.
Nonetheless, I've just built the latest Freetype2 from git (thus including the "Fortify dllexport/dllimport attributes"-commit) and built a shared FFmpeg again and this time 'libavfilter/avfilter-7.dll' was created without any problems. This bug(-discussion) can thus remain fixed/closed.
Thank you.

Reino Wijnsma <reino>
Thu 26 Jul 2018 08:35:12 AM UTC, comment #20: 

Works like a charm. Thanks a lot.

Anonymous
Wed 25 Jul 2018 03:05:49 AM UTC, comment #19: 

Ok, this should be fixed now. Please test.

Alexei Podtelezhnikov <podtelez>
Group Member
Tue 24 Jul 2018 11:05:09 AM UTC, comment #18: 

Yes, /MD is enabled in my static FreeType build. Since my final project is a DLL, I want to link with dynamic CRT. It is not recommended to mix /MD and /MT, hence I also build all the libraries my DLL depends on with /MD.

Anonymous
Mon 23 Jul 2018 02:35:38 PM UTC, comment #17: 

The problem is that you set /MD instead of /MT when building static FreeType, isn't it? I am not following why do you need to have /MD for static library.

Alexei Podtelezhnikov <podtelez>
Group Member
Mon 23 Jul 2018 11:06:36 AM UTC, comment #16: 

I opend another bug with the same issue:
https://savannah.nongnu.org/bugs/index.php?54330

In our case it is not related to ffmpeg but a custom DLL.

Regarding comment #9 here:
Not defining DLL_EXPORT is unfortunately not enough when building FreeType as a static library.

The problematic line in ftconfig.h is:

#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )


DLL_EXPORT is never checked because the compiler defines _DLL when /MD or /MDd is set (at least MSVC does this):
https://msdn.microsoft.com/en-us/library/b0084kay.aspx


Anonymous
Thu 21 Jun 2018 03:27:07 PM UTC, comment #15: 

The errors suggest that both libfreetype.a and libavformat.dll.a provide FreeType. That would be a problem to link togeher. Perhaps your --enable-libfreetype is spurious. Perhaps you get it compiled in even without it. Your build system remains a black box for me. I tried but I cannot see how it works. Sorry.

Please try to solve it with mingw team. They are the experts.

Alexei Podtelezhnikov <podtelez>
Group Member
Thu 21 Jun 2018 10:41:32 AM UTC, comment #14: 

I'm not an expert at this. Unless you can tell me exactly what file in my local FFmpeg repo you want to have a look at, the following console output is all I can give you:

EXTERN_PREFIX="_" AR="/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-ar" NM="/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-nm -g" ./compat/windows/makedef libavfilter/libavfilter.ver libavfilter/aeval.o libavfilter/af_acontrast.o libavfilter/af_acopy.o libavfilter/af_acrusher.o libavfilter/af_adelay.o libavfilter/af_aderivative.o libavfilter/af_aecho.o libavfilter/af_aemphasis.o libavfilter/af_afade.o libavfilter/af_afftfilt.o libavfilter/af_afir.o libavfilter/af_aformat.o libavfilter/af_agate.o libavfilter/af_aiir.o libavfilter/af_alimiter.o libavfilter/af_amerge.o libavfilter/af_amix.o libavfilter/af_anequalizer.o libavfilter/af_anull.o libavfilter/af_apad.o libavfilter/af_aphaser.o libavfilter/af_apulsator.o libavfilter/af_aresample.o libavfilter/af_asetnsamples.o libavfilter/af_asetrate.o libavfilter/af_ashowinfo.o libavfilter/af_astats.o libavfilter/af_atempo.o libavfilter/af_biquads.o libavfilter/af_bs2b.o libavfilter/af_channelmap.o libavfilter/af_channelsplit.o libavfilter/af_chorus.o libavfilter/af_compand.o libavfilter/af_compensationdelay.o libavfilter/af_crossfeed.o libavfilter/af_crystalizer.o libavfilter/af_dcshift.o libavfilter/af_drmeter.o libavfilter/af_dynaudnorm.o libavfilter/af_earwax.o libavfilter/af_extrastereo.o libavfilter/af_firequalizer.o libavfilter/af_flanger.o libavfilter/af_haas.o libavfilter/af_hdcd.o libavfilter/af_headphone.o libavfilter/af_join.o libavfilter/af_loudnorm.o libavfilter/af_mcompand.o libavfilter/af_pan.o libavfilter/af_replaygain.o libavfilter/af_rubberband.o libavfilter/af_sidechaincompress.o libavfilter/af_silencedetect.o libavfilter/af_silenceremove.o libavfilter/af_sofalizer.o libavfilter/af_stereotools.o libavfilter/af_stereowiden.o libavfilter/af_superequalizer.o libavfilter/af_surround.o libavfilter/af_tremolo.o libavfilter/af_vibrato.o libavfilter/af_volume.o libavfilter/af_volumedetect.o libavfilter/allfilters.o libavfilter/asink_anullsink.o libavfilter/asrc_anoisesrc.o libavfilter/asrc_anullsrc.o libavfilter/asrc_flite.o libavfilter/asrc_hilbert.o libavfilter/asrc_sine.o libavfilter/audio.o libavfilter/avf_abitscope.o libavfilter/avf_ahistogram.o libavfilter/avf_aphasemeter.o libavfilter/avf_avectorscope.o libavfilter/avf_concat.o libavfilter/avf_showcqt.o libavfilter/avf_showfreqs.o libavfilter/avf_showspectrum.o libavfilter/avf_showvolume.o libavfilter/avf_showwaves.o libavfilter/avfilter.o libavfilter/avfiltergraph.o libavfilter/bbox.o libavfilter/buffersink.o libavfilter/buffersrc.o libavfilter/colorspacedsp.o libavfilter/drawutils.o libavfilter/ebur128.o libavfilter/f_bench.o libavfilter/f_drawgraph.o libavfilter/f_ebur128.o libavfilter/f_interleave.o libavfilter/f_loop.o libavfilter/f_metadata.o libavfilter/f_perms.o libavfilter/f_realtime.o libavfilter/f_reverse.o libavfilter/f_select.o libavfilter/f_sendcmd.o libavfilter/f_sidedata.o libavfilter/f_streamselect.o libavfilter/fifo.o libavfilter/formats.o libavfilter/framepool.o libavfilter/framequeue.o libavfilter/framesync.o libavfilter/generate_wave_table.o libavfilter/graphdump.o libavfilter/graphparser.o libavfilter/lavfutils.o libavfilter/log2_tab.o libavfilter/lswsutils.o libavfilter/motion_estimation.o libavfilter/pthread.o libavfilter/scale.o libavfilter/setpts.o libavfilter/settb.o libavfilter/split.o libavfilter/src_movie.o libavfilter/transform.o libavfilter/trim.o libavfilter/vaf_spectrumsynth.o libavfilter/vf_alphamerge.o libavfilter/vf_amplify.o libavfilter/vf_aspect.o libavfilter/vf_atadenoise.o libavfilter/vf_avgblur.o libavfilter/vf_bbox.o libavfilter/vf_bitplanenoise.o libavfilter/vf_blackdetect.o libavfilter/vf_blackframe.o libavfilter/vf_blend.o libavfilter/vf_boxblur.o libavfilter/vf_bwdif.o libavfilter/vf_chromakey.o libavfilter/vf_ciescope.o libavfilter/vf_codecview.o libavfilter/vf_colorbalance.o libavfilter/vf_colorchannelmixer.o libavfilter/vf_colorkey.o libavfilter/vf_colorlevels.o libavfilter/vf_colormatrix.o libavfilter/vf_colorspace.o libavfilter/vf_convolution.o libavfilter/vf_convolve.o libavfilter/vf_copy.o libavfilter/vf_cover_rect.o libavfilter/vf_crop.o libavfilter/vf_cropdetect.o libavfilter/vf_curves.o libavfilter/vf_datascope.o libavfilter/vf_dctdnoiz.o libavfilter/vf_deband.o libavfilter/vf_deblock.o libavfilter/vf_decimate.o libavfilter/vf_deflicker.o libavfilter/vf_dejudder.o libavfilter/vf_delogo.o libavfilter/vf_deshake.o libavfilter/vf_despill.o libavfilter/vf_detelecine.o libavfilter/vf_displace.o libavfilter/vf_drawbox.o libavfilter/vf_drawtext.o libavfilter/vf_edgedetect.o libavfilter/vf_elbg.o libavfilter/vf_entropy.o libavfilter/vf_eq.o libavfilter/vf_extractplanes.o libavfilter/vf_fade.o libavfilter/vf_fftdnoiz.o libavfilter/vf_fftfilt.o libavfilter/vf_field.o libavfilter/vf_fieldhint.o libavfilter/vf_fieldmatch.o libavfilter/vf_fieldorder.o libavfilter/vf_fillborders.o libavfilter/vf_find_rect.o libavfilter/vf_floodfill.o libavfilter/vf_format.o libavfilter/vf_fps.o libavfilter/vf_framepack.o libavfilter/vf_framerate.o libavfilter/vf_framestep.o libavfilter/vf_frei0r.o libavfilter/vf_fspp.o libavfilter/vf_gblur.o libavfilter/vf_geq.o libavfilter/vf_gradfun.o libavfilter/vf_hflip.o libavfilter/vf_histeq.o libavfilter/vf_histogram.o libavfilter/vf_hqdn3d.o libavfilter/vf_hqx.o libavfilter/vf_hue.o libavfilter/vf_hwdownload.o libavfilter/vf_hwmap.o libavfilter/vf_hwupload.o libavfilter/vf_hysteresis.o libavfilter/vf_idet.o libavfilter/vf_il.o libavfilter/vf_kerndeint.o libavfilter/vf_lenscorrection.o libavfilter/vf_limiter.o libavfilter/vf_lumakey.o libavfilter/vf_lut.o libavfilter/vf_lut2.o libavfilter/vf_lut3d.o libavfilter/vf_maskedclamp.o libavfilter/vf_maskedmerge.o libavfilter/vf_mcdeint.o libavfilter/vf_mergeplanes.o libavfilter/vf_mestimate.o libavfilter/vf_midequalizer.o libavfilter/vf_minterpolate.o libavfilter/vf_mix.o libavfilter/vf_mpdecimate.o libavfilter/vf_neighbor.o libavfilter/vf_nlmeans.o libavfilter/vf_nnedi.o libavfilter/vf_noise.o libavfilter/vf_normalize.o libavfilter/vf_null.o libavfilter/vf_overlay.o libavfilter/vf_owdenoise.o libavfilter/vf_pad.o libavfilter/vf_palettegen.o libavfilter/vf_paletteuse.o libavfilter/vf_perspective.o libavfilter/vf_phase.o libavfilter/vf_pixdesctest.o libavfilter/vf_pp.o libavfilter/vf_pp7.o libavfilter/vf_premultiply.o libavfilter/vf_pseudocolor.o libavfilter/vf_psnr.o libavfilter/vf_pullup.o libavfilter/vf_qp.o libavfilter/vf_random.o libavfilter/vf_readeia608.o libavfilter/vf_readvitc.o libavfilter/vf_remap.o libavfilter/vf_removegrain.o libavfilter/vf_removelogo.o libavfilter/vf_repeatfields.o libavfilter/vf_rotate.o libavfilter/vf_sab.o libavfilter/vf_scale.o libavfilter/vf_selectivecolor.o libavfilter/vf_separatefields.o libavfilter/vf_setfield.o libavfilter/vf_setparams.o libavfilter/vf_showinfo.o libavfilter/vf_showpalette.o libavfilter/vf_shuffleframes.o libavfilter/vf_shuffleplanes.o libavfilter/vf_signalstats.o libavfilter/vf_signature.o libavfilter/vf_smartblur.o libavfilter/vf_spp.o libavfilter/vf_srcnn.o libavfilter/vf_ssim.o libavfilter/vf_stack.o libavfilter/vf_stereo3d.o libavfilter/vf_subtitles.o libavfilter/vf_super2xsai.o libavfilter/vf_swaprect.o libavfilter/vf_swapuv.o libavfilter/vf_telecine.o libavfilter/vf_threshold.o libavfilter/vf_thumbnail.o libavfilter/vf_tile.o libavfilter/vf_tinterlace.o libavfilter/vf_tonemap.o libavfilter/vf_transpose.o libavfilter/vf_unsharp.o libavfilter/vf_uspp.o libavfilter/vf_vaguedenoiser.o libavfilter/vf_vectorscope.o libavfilter/vf_vflip.o libavfilter/vf_vfrdet.o libavfilter/vf_vidstabdetect.o libavfilter/vf_vidstabtransform.o libavfilter/vf_vignette.o libavfilter/vf_vmafmotion.o libavfilter/vf_w3fdif.o libavfilter/vf_waveform.o libavfilter/vf_weave.o libavfilter/vf_xbr.o libavfilter/vf_yadif.o libavfilter/vf_zoompan.o libavfilter/vf_zscale.o libavfilter/video.o libavfilter/vidstabutils.o libavfilter/vsink_nullsink.o libavfilter/vsrc_cellauto.o libavfilter/vsrc_life.o libavfilter/vsrc_mandelbrot.o libavfilter/vsrc_mptestsrc.o libavfilter/vsrc_testsrc.o libavfilter/x86/af_afir.o libavfilter/x86/af_afir_init.o libavfilter/x86/af_volume.o libavfilter/x86/af_volume_init.o libavfilter/x86/avf_showcqt.o libavfilter/x86/avf_showcqt_init.o libavfilter/x86/colorspacedsp.o libavfilter/x86/colorspacedsp_init.o libavfilter/x86/vf_blend.o libavfilter/x86/vf_blend_init.o libavfilter/x86/vf_bwdif.o libavfilter/x86/vf_bwdif_init.o libavfilter/x86/vf_eq.o libavfilter/x86/vf_framerate.o libavfilter/x86/vf_framerate_init.o libavfilter/x86/vf_fspp.o libavfilter/x86/vf_fspp_init.o libavfilter/x86/vf_gradfun.o libavfilter/x86/vf_gradfun_init.o libavfilter/x86/vf_hflip.o libavfilter/x86/vf_hflip_init.o libavfilter/x86/vf_hqdn3d.o libavfilter/x86/vf_hqdn3d_init.o libavfilter/x86/vf_idet.o libavfilter/x86/vf_idet_init.o libavfilter/x86/vf_interlace.o libavfilter/x86/vf_limiter.o libavfilter/x86/vf_limiter_init.o libavfilter/x86/vf_maskedmerge.o libavfilter/x86/vf_maskedmerge_init.o libavfilter/x86/vf_noise.o libavfilter/x86/vf_overlay.o libavfilter/x86/vf_overlay_init.o libavfilter/x86/vf_pp7.o libavfilter/x86/vf_pp7_init.o libavfilter/x86/vf_psnr.o libavfilter/x86/vf_psnr_init.o libavfilter/x86/vf_pullup.o libavfilter/x86/vf_pullup_init.o libavfilter/x86/vf_removegrain.o libavfilter/x86/vf_removegrain_init.o libavfilter/x86/vf_spp.o libavfilter/x86/vf_ssim.o libavfilter/x86/vf_ssim_init.o libavfilter/x86/vf_stereo3d.o libavfilter/x86/vf_stereo3d_init.o libavfilter/x86/vf_threshold.o libavfilter/x86/vf_threshold_init.o libavfilter/x86/vf_tinterlace_init.o libavfilter/x86/vf_w3fdif.o libavfilter/x86/vf_w3fdif_init.o libavfilter/x86/vf_yadif.o libavfilter/x86/vf_yadif_init.o libavfilter/x86/yadif-10.o libavfilter/x86/yadif-16.o > libavfilter/avfilter-7.def
LD      libavfilter/avfilter-7.dll
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x22a0): multiple definition of `FT_Done_Face'
libavformat/libavformat.dll.a(d000017.o):(.text+0x0): first defined here
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2ab0): multiple definition of `FT_Set_Char_Size'
libavformat/libavformat.dll.a(d000104.o):(.text+0x0): first defined here
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2b50): multiple definition of `FT_Set_Pixel_Sizes'
libavformat/libavformat.dll.a(d000108.o):(.text+0x0): first defined here
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2bd0): multiple definition of `FT_Get_Kerning'
libavformat/libavformat.dll.a(d000037.o):(.text+0x0): first defined here
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x5570): multiple definition of `FT_Load_Char'
libavformat/libavformat.dll.a(d000066.o):(.text+0x0): first defined here
/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0xac20): multiple definition of `FT_New_Face'
libavformat/libavformat.dll.a(d000073.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [ffbuild/library.mak:103: libavfilter/avfilter-7.dll] Error 1


'ffbuild/library.mak':

include $(SRC_PATH)/ffbuild/common.mak

ifeq (,$(filter %clean config,$(MAKECMDGOALS)))
-include $(SUBDIR)lib$(NAME).version
endif

LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR   := $(lib$(NAME)_VERSION_MAJOR)
LIBMINOR   := $(lib$(NAME)_VERSION_MINOR)
INCINSTDIR := $(INCDIR)/lib$(NAME)

INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)

all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)  $(SUBDIR)lib$(FULLNAME).pc
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) $(SUBDIR)lib$(FULLNAME).pc

LIBOBJS := $(OBJS) $(SUBDIR)%.h.o $(TESTOBJS)
$(LIBOBJS) $(LIBOBJS:.o=.s) $(LIBOBJS:.o=.i):   CPPFLAGS += -DHAVE_AV_CONFIG_H

$(SUBDIR)$(LIBNAME): $(OBJS)
        $(RM) $@
        $(AR) $(ARFLAGS) $(AR_O) $^
        $(RANLIB) $@

install-headers: install-lib$(NAME)-headers install-lib$(NAME)-pkgconfig

install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared

define RULES
$(TOOLS):     THISLIB = $(FULLNAME:%=$(LD_LIB))
$(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME)

$(LIBOBJS): CPPFLAGS += -DBUILDING_$(NAME)

$(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
        $$(LD) $(LDFLAGS) $(LDEXEFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(EXTRALIBS-$$(*F)) $$(ELIBS)

$(SUBDIR)lib$(NAME).version: $(SUBDIR)version.h | $(SUBDIR)
        $$(M) $$(SRC_PATH)/ffbuild/libversion.sh $(NAME) $$< > $$@

$(SUBDIR)lib$(FULLNAME).pc: $(SUBDIR)version.h ffbuild/config.sh | $(SUBDIR)
        $$(M) $$(SRC_PATH)/ffbuild/pkgconfig_generate.sh $(NAME) "$(DESC)"

$(SUBDIR)lib$(NAME).ver: $(SUBDIR)lib$(NAME).v $(OBJS)
        $$(M)sed 's/MAJOR/$(lib$(NAME)_VERSION_MAJOR)/' $$< | $(VERSION_SCRIPT_POSTPROCESS_CMD) > $$@

$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
        $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)

$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
        $(SLIB_CREATE_DEF_CMD)
        $$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS)
        $(SLIB_EXTRA_CMD)

ifdef SUBDIR
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(DEP_LIBS)
endif

clean::
        $(RM) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
            $(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(CLEANSUFFIXES:%=$(SUBDIR)tests/%)

install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
        $(Q)mkdir -p "$(SHLIBDIR)"
        $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
        $$(STRIP) "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)"
        $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),(cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F));)
        $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)")
        $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)")
        $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)")

install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
        $(Q)mkdir -p "$(LIBDIR)"
        $$(INSTALL) -m 644 $$< "$(LIBDIR)"
        $(LIB_INSTALL_EXTRA_CMD)

install-lib$(NAME)-headers: $(addprefix $(SUBDIR),$(HEADERS) $(BUILT_HEADERS))
        $(Q)mkdir -p "$(INCINSTDIR)"
        $$(INSTALL) -m 644 $$^ "$(INCINSTDIR)"

install-lib$(NAME)-pkgconfig: $(SUBDIR)lib$(FULLNAME).pc
        $(Q)mkdir -p "$(PKGCONFIGDIR)"
        $$(INSTALL) -m 644 $$^ "$(PKGCONFIGDIR)"

uninstall-libs::
        -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \
               "$(SHLIBDIR)/$(SLIBNAME)"            \
               "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
        -$(RM)  $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)/%")
        -$(RM)  $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)/%")
        -$(RM) "$(LIBDIR)/$(LIBNAME)"

uninstall-headers::
        $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
        -rmdir "$(INCINSTDIR)"

uninstall-pkgconfig::
        $(RM) "$(PKGCONFIGDIR)/lib$(FULLNAME).pc"
endef

$(eval $(RULES))

$(TOOLS):     $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME)
$(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME)

testprogs: $(TESTPROGS)


Reino Wijnsma <reino>
Wed 20 Jun 2018 07:36:41 PM UTC, comment #13: 

I would like to see the context of the error, that is the command line that triggers it. So far you've shown that libfreetype.a is build correctly without any errors. You have not shown the command line that gives you that error, to be specific, not just the make command but the the actual gcc invocation.

Alexei Podtelezhnikov <podtelez>
Group Member
Thu 14 Jun 2018 09:55:35 PM UTC, comment #12: 

I take it you mean FFmpeg's config.log: https://rwijnsma.home.xs4all.nl/files/temp/ffmpeg_config(freetype-excerpt).log

'freetype2.pc' here look like:

prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
exec_prefix=/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32
libdir=/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib
includedir=/cygdrive/m/ffmpeg-windows-build-helpers-master/ffmpeg_local_builds/sandbox/cross_compilers/mingw-w64-i686/i686-w64-mingw32/include

Name: FreeType 2
URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
Version: 22.1.16
Requires:
Requires.private: zlib
Libs: -L${libdir} -lfreetype
Libs.private: -lbz2
Cflags: -I${includedir}/freetype2


>> If you use static FreeType, FT2_BUILD_LIBRARY should not be defined.
> Everything looks fine,...
In 'freetype-2.9.1_build.log' I can see Freetype is made with '-DFT2_BUILD_LIBRARY' though. That isn't wrong?

Reino Wijnsma <reino>
Thu 14 Jun 2018 05:09:51 PM UTC, comment #11: 

Everything looks fine, unless i686-w64-mingw32-gcc hides DLL_EXPORT or _DLL.

For completeness pleas post logs how libfreetype.a is picked up for avfilter-7.dll.

Alexei Podtelezhnikov <podtelez>
Group Member
Thu 14 Jun 2018 01:58:42 PM UTC, comment #10: 

I never asked you to ;), but if you'd like to that's fine.
My script: https://github.com/Reino17/ffmpeg-windows-build-helpers/blob/master/ffmpeg_local_builds/cross_compile_ffmpeg.sh

I haven't updated FreeType here yet, so this is the updated FreeType function I'm using:

build_freetype() {
  #download_and_unpack_file https://sourceforge.net/projects/freetype/files/freetype2/2.9.1/freetype-2.9.1.tar.bz2
  download_and_unpack_file https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.bz2
  cd freetype-2.9.1
    if [[ ! -f builds/unix/install.mk.bak ]]; then # Library only.
      sed -i.bak "/config \\\/s/\s*\\\//;/bindir) /s/\s*\\\//;/aclocal/d;/man1/d;/BUILD_DIR/d;/docs/d" builds/unix/install.mk
    fi
    generic_configure "--build=i686-pc-cygwin" # Without '--build=i686-pc-cygwin' you'd get: "could not open '/cygdrive/[...]/include/freetype/ttnameid.h' for writing".
    do_make_and_make_install
  cd ..
} # [zlib, bzip2, libpng]


The console output I see while building FreeType 2.9.1: https://rwijnsma.home.xs4all.nl/files/temp/freetype-2.9.1_build.log
And the actual config.log: https://rwijnsma.home.xs4all.nl/files/temp/config.log

Reino Wijnsma <reino>
Thu 14 Jun 2018 12:54:12 PM UTC, comment #9: 


> What needs to be fixed?


Fix this potential errors:

If you build static FreeType, DLL_EXPORT should not defined?

If you use static FreeType, FT2_BUILD_LIBRARY should not be defined.

Most importantly though, if you want me to troubleshoot your build process, provide a link to your configure script and attache full build log. Otherwise I am just guessing where you are making a mistake.

Alexei Podtelezhnikov <podtelez>
Group Member
Thu 14 Jun 2018 12:13:11 PM UTC, comment #8: 

> Does this mean to statically link FreeType into shared FFmpeg?
Yes it does.

> I would suggest building FreeType separately, or fixing the crazy build system.
What do you mean "separately"? What's crazy about it? What needs to be fixed?

> The multiple definitions might be coming from simultaneously linking static and dynamic FreeType images too.
I only have a static FreeType library installed.

> Notice that FreeType itself builds just fine.
I never said it didn't.

> Please try without --enable-libfreetype.
It's FreeType that caused the compilation failure. Obviously without --enable-libfreetype FFmpeg would compile successfully. What's the point? I don't understand.

Reino Wijnsma <reino>
Thu 14 Jun 2018 11:03:35 AM UTC, comment #7: 

This is relevant piece:


./confiure --enable-libfreetype --enable-shared --disable-static


Does this mean to statically link FreeType into shared FFmpeg? I would suggest building FreeType separately, or fixing the crazy build system. The multiple definitions might be coming from simultaneously linking static and dynamic FreeType images too. Notice that FreeType itself builds just fine.

Please try without --enable-libfreetype.



Alexei Podtelezhnikov <podtelez>
Group Member
Thu 14 Jun 2018 04:23:49 AM UTC, comment #6: 

Thanks.  Alexei, please take care of it.

Werner LEMBERG <wl>
Group administrator
Wed 13 Jun 2018 11:16:22 PM UTC, comment #5: 

I'm linking a static freetype build (as are all my other libraries) to compile a shared ffmpeg build. This commit caused the compilation failure.
See the ffmpeg tracker on how I fixed it.

Reino Wijnsma <reino>
Wed 06 Jun 2018 06:36:19 AM UTC, comment #4: 

OK.  In this case I suggest that you contact an ffmpeg mailing list or forum for further advice.  Please post an update here in case there is really a FreeType problem to be fixed on our side.

Werner LEMBERG <wl>
Group administrator
Tue 05 Jun 2018 11:15:18 PM UTC, comment #3: 

That's because I haven't gotten an answer here either.

Reino Wijnsma <reino>
Tue 05 Jun 2018 05:42:36 AM UTC, comment #2: 

I'm closing this now since no response.

Werner LEMBERG <wl>
Group administrator
Fri 25 May 2018 06:12:46 AM UTC, comment #1: 

I suggest that you first contact the ffmpeg people for support – for me it seems that you are compiling two versions of FreeType into ffmpeg.

Werner LEMBERG <wl>
Group administrator
Thu 24 May 2018 01:02:21 PM UTC, original submission:  

Hello,

I'm cross-compiling FFmpeg on Windows (using Cygwin, MinGW and GCC).
I've just updated Freetype from v2.9 to v2.9.1 and tried to compile a shared FFmpeg build, but suddenly got the following:

LD      libavfilter/avfilter-7.dll
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x22a0): multiple definition of `FT_Done_Face'
libavformat/libavformat.dll.a(d000017.o):(.text+0x0): first defined here
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2ab0): multiple definition of `FT_Set_Char_Size'
libavformat/libavformat.dll.a(d000104.o):(.text+0x0): first defined here
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2b50): multiple definition of `FT_Set_Pixel_Sizes'
libavformat/libavformat.dll.a(d000108.o):(.text+0x0): first defined here
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x2bd0): multiple definition of `FT_Get_Kerning'
libavformat/libavformat.dll.a(d000037.o):(.text+0x0): first defined here
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0x5570): multiple definition of `FT_Load_Char'
libavformat/libavformat.dll.a(d000066.o):(.text+0x0): first defined here
/cygdrive/[...]/i686-w64-mingw32/lib/libfreetype.a(ftbase.o):ftbase.c:(.text+0xac20): multiple definition of `FT_New_Face'
libavformat/libavformat.dll.a(d000073.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make: * [ffbuild/library.mak:103: libavfilter/avfilter-7.dll] Error 1

I'm not that tech-savvy to understand what's causing this exactly.
Is this a regression in Freetype v2.9.1, or is FFmpeg to blame here?

-- Reino

Reino Wijnsma <reino>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by podtelez (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  • -email is unavailable- added by reino (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-26 podtelez StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2018-07-25 podtelez StatusConfirmed Ready For Test
        Planned ReleaseNone 2.10.0
    2018-06-14 wl Assigned towl podtelez
        Open/ClosedClosed Open
    2018-06-14 wl StatusInvalid Confirmed
    2018-06-05 wl StatusNone Invalid
        Assigned toNone wl
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code