bugThe FreeType Project - Bugs: bug #54330, dllexport defined even if build as...

 
 

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

bug #54330: dllexport defined even if build as static library

Submitter:  None
Submitted:  Wed 18 Jul 2018 11:50:11 AM UTC
   
 
Severity:  3 - Normal Item Group:  Hack required
Status:  Duplicate Privacy:  Public
Assigned to:  podtelez Open/Closed:  Closed
Planned Release:  2.10.0

Mon 23 Jul 2018 02:43:10 PM UTC, comment #4: 


> 1. Compile FreeType as a static library using MSVC and ensure that the option /MD or /MDd is set.


Isn't this wrong build setup? Seriously, I am not a Windows expert and do not know if there is any valid reason to build static library with /MD instead of /MT.

Alexei Podtelezhnikov <podtelez>
Group Member
Mon 23 Jul 2018 10:59:17 AM UTC, comment #3: 

I just looked through the open bugs and found:
https://savannah.nongnu.org/bugs/index.php?53969

I think this bug is a duplicate of #53969

Sorry, that I missed it the first time.

Anonymous
Mon 23 Jul 2018 10:52:47 AM UTC, comment #2: 

Hi,

I am using the following Git commit e0015f7612cf07ff80561475321ce1f98c7c2b88 (version 2.9.1). However, the issue should be reproducable with the latest FreeType version as well.

The compiler is MSVC 2015 but any other MSVC version should also produce the incorrect DLL.

There is no error message since my DLL builds fine. However, when you run

dumpbin /exports a.dll


on the generated DLL, you see that the DLL exports all FreeType functions.




I do not think the issue is not limited to CMake. I suggest the following steps to reproduce the problem:

1. Compile FreeType as a static library using MSVC and ensure that the option /MD or /MDd is set.

2. Build a DLL that links against the static FreeType library.

3. Run "dumpbin /exports" on the final DLL.

In the last step, you will see that your DLL exports all FreeType functions.

Anonymous
Thu 19 Jul 2018 09:22:41 PM UTC, comment #1: 

FreeType's cmake support is contributed code, and cmake used on Windows is probably the least used combination...  This means there might be real issues.

However, your report is quite incomplete: What FreeType version?  Which compiler?  What's the exact compiler (or linker) error message?

Werner LEMBERG <wl>
Group administrator
Wed 18 Jul 2018 11:50:11 AM UTC, original submission:  

Hi,

we have a CMake project that includes the FreeType library as a subproject. Our project builds a DLL and FreeType is included as a static library.

The problem is that FreeType exports alls symbols although it is a static library. Hence, our DLL exports the FreeType symbols.

I could not find a CMake option or a macro (that can be defined via CMake) to disable the dllexport definition. I think, this is the line from ftconfig.h is responsible for the setting:


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


Since _WIN32 and _DLL are defined by the compiler, the setting of DLL_EXPORT is never checked.

Best regards,

Anonymous

 

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

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-25 podtelez Open/ClosedOpen Closed
        Planned ReleaseNone 2.10.0
    2018-07-23 wl StatusNeed Info Duplicate
        Assigned toNone podtelez
    2018-07-19 wl StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code