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

 
 

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

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

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

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>
Project MemberIn charge of this item.
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:

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>
Project MemberIn charge of this item.
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:

'ffbuild/library.mak':

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>
Project MemberIn charge of this item.
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:

>> 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>
Project MemberIn charge of this item.
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:

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>
Project MemberIn charge of this item.
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:

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>
Project MemberIn charge of this item.
Thu 14 Jun 2018 04:23:49 AM UTC, comment #6:

Thanks. Alexei, please take care of it.

Werner LEMBERG <wl>
Project 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>
Project 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>
Project 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>
Project 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.)

Attach Files:
   
   
Comment:
   

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)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.3