#298 C# shared libraries & Win64 target

2.4.3
open
None
9
2014-06-13
2013-08-08
Sebastian
No

When chosing "Visual Studio xxxx Win64" in CMake as target platform for the C# shared libraries, two preprocessor directives are not properly set to "WIN64" resulting in a failing build process:

Utilities\socketxx\socket++\fork.cpp, line 11
Common\gdcmWin32.h, line 23

As a result of the second, gdcmCommon has no exports defined and no gdcmCommon.lib file is created - which is later missing for gdcmDICT, gdcmMSFF etc.

Additionally I changed in CMake directly:
=== CMAKE_CXX_FLAGS ===
/DWIN32 /D_WINDOWS /W3 /GR /EHsc
to
/DWIN64 /D_WINDOWS /W3 /GR /EHsc

=== CMAKE_C_FLAGS ===
/DWIN32 /D_WINDOWS /W3
to
/DWIN64 /D_WINDOWS /W3

Having done so allows a successful build of 64bit DLLs.

Discussion

    • assigned_to: Mathieu Malaterre
    • Priority: 3 --> 1
     
  • I am not sure how you managed to get there. I would have guessed CMake always defined WIN32 even for 64bits build...

     
  • I guess changing:

    if defined(WIN32) && defined(GDCM_BUILD_SHARED_LIBS)

    into

    if defined(_WIN32) && defined(GDCM_BUILD_SHARED_LIBS)

    may work.

    Could you confirm ?

     
    • Group: 2.2.5 --> 2.4.3
    • Priority: 1 --> 9