View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005020CMakeCMakepublic2007-05-11 15:272016-06-10 14:30
ReporterJesus Lopez 
Assigned ToBill Hoffman 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005020: DEF files in MinGW
DescriptionI'm trying to use a hand made .DEF file (with aliases) to link a
certain DLL with MinGW. I tried this way but with no success:

    project(kaka)
    add_library(kk SHARED kk.c kk.def)

The generated Makefile didn't pass the DEF file to the linking stage.
I would like to see this implemented.

The way to do this by hand would be:
gcc -o kk.dll -shared kk.o kk.def

While other generators use the DEF file, MinGW's simply ignore it.

Thank U!
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0024729)
Maddes (reporter)
2011-01-16 09:58

I can confirm this behaviour with CMake 2.8.3.

The reason is that CMAKE_LINK_DEF_FILE_FLAG is ignored, unless explicitly set to empty.
I assume CMake ignores it as it has still its empty default value, but this is the correct value for GNUC/CC on Windows.

I use the following code as a workaround:
# GCC specialities
if(${CMAKE_COMPILER_IS_GNUCC})
    if(${WIN32})
        set(CMAKE_LINK_DEF_FILE_FLAG "") # CMake workaround (2.8.3)
        set(CMAKE_SHARED_LIBRARY_PREFIX "") # DLLs do not have a "lib" prefix
        set(CMAKE_IMPORT_LIBRARY_PREFIX "") # same for DLL import libs
    endif()
endif()
(0041357)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2011-01-16 09:58 Maddes Note Added: 0024729
2016-06-10 14:27 Kitware Robot Note Added: 0041357
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team