View Issue Details

IDProjectCategoryView StatusLast Update
0027197Open CASCADEOCCT:Configurationpublic2020-06-11 08:35
Reporterkgv Assigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.0.0 
Summary0027197: Configuration - fix compilation issues when using mingw
DescriptionThere are several issues occur when compiling OCCT using mingw - like misuse of _WIN32 and _MSC_VER macros.
Steps To ReproduceN/A
TagsNo tags attached.
Test case number

Attached Files

  • mingw_warnings_gcc51.txt (34,694 bytes)

Relationships

related to 0027196 closedbugmaster Community CMake - avoid setting option -EHa for compilers other than MSVC 
parent of 0027232 closedkgv Open CASCADE Configuration - fix mblen missing building issue on Android 
parent of 0030609 closedapn Open CASCADE Coding - eliminate warnings issued by gcc 8.1.0 
parent of 0031606 closedbugmaster Open CASCADE Configuration, CMake - build fails with Android NDK + CLang compiler + MinGW Makefiles 
related to 0029317 closedbugmaster Open CASCADE Configuration, CMake - CSF_d3d9 should be processed for building TKD3DHost using MinGW 
related to 0030091 closedbugmaster Community Configuration - allow cross-compilation from Linux (case sensitive filesystem) to x86_64-w64-mingw32 

Activities

git

2016-02-22 22:12

administrator   ~0051062

Branch CR27197 has been created by kgv.

SHA-1: 37d515f993f5413169c25b58730e0ace98ac4100


Detailed log of new commits:

Author: kgv
Date: Mon Feb 22 22:03:05 2016 +0300

    0027197: Configuration - fix compilation issues when using mingw
    
    AIS_ColorScale, AIS_Dimension - the protected method DrawText()
    has been renamed to drawText() to avoid name collisions with macros.
    
    _MSC_VER/_WIN32 misuse has been fixed in several places.
    Header <malloc.h> is now included where alloca() is used.
    Draw_Window - dllimport flag has been dropped from inline methods.
    
    TKernel - mandatory dependencies Winspool.lib and Psapi.lib
    are now linked explicitly (instead of msvc-specific pragma syntax).
    
    CMake scripts - the option -std=c++0x has been replaced by -std=gnu++0x
    for mingw to allow extensions (like _wfopen() and others).
    The minimum Windows version has been set to _WIN32_WINNT=0x0501.
    Invalid options "-z defs" and "-lm" have been dropped for mingw.

Author: kgv
Date: Mon Feb 22 22:07:45 2016 +0300

    0027198: OSD_Environment - use wide characters API on Windows

BenjaminBihler

2016-02-23 12:04

updater   ~0051063

Are you working on MinGW support? Oh this would be so great, so really great!!! I will test it a lot and give you as much feedback as possible!

BenjaminBihler

2016-02-23 12:18

updater   ~0051064

If I want to compile the current revision in branch CR27197 with MinGW64 using g++ 5.2.0, I get an compilation error in OSD_WNT_1.hxx:

d:/OpenCascade/Occt/src/OSD/OSD_WNT_1.hxx:39:15: error: multiple types in one declaration
 #define _TINT int

I had also fixed that in the community edition one year ago. Which MinGW version will be supported by you?

git

2016-02-23 15:38

administrator   ~0051065

Branch CR27197 has been updated by kgv.

SHA-1: 5587b45e8b68b0b513f0e9db520ea1dc7244843f


Detailed log of new commits:

Author: kgv
Date: Tue Feb 23 15:38:29 2016 +0300

    Draw::Load() - "lib" suffix is now prepended on mingw as well

kgv

2016-02-23 15:46

developer  

mingw_warnings_gcc51.txt (34,694 bytes)

git

2016-02-23 19:44

administrator   ~0051066

Branch CR27197 has been updated by kgv.

SHA-1: 35cb4cf58a71eb1ff5a3499de02ff0ddd3a58944


Detailed log of new commits:

Author: kgv
Date: Tue Feb 23 19:44:40 2016 +0300

    CMake - add --export-all-symbols flag to CMAKE_SHARED_LINKER_FLAGS for mingw
    
    to workaround missing vtable symbols.

Author: kgv
Date: Tue Feb 23 19:40:10 2016 +0300

    Drop redundant declaration of _TINT from OSD_WNT_1.hxx.
    NCollection_UtfString::FromLocale() - platform-specific code has been moved to .cxx file.
    Draw_BasicCommands - fixed incorrect mingw64 version macros.

kgv

2016-02-23 19:50

developer   ~0051067

Benjamin,

> If I want to compile the current revision in branch CR27197
> with MinGW64 using g++ 5.2.0, I get an compilation error in OSD_WNT_1.hxx:
I've used mingw with gcc 4.9 and 5.1 for 32-bit target.
Now I have tried to build using 64-bit target (gcc 5.1) and indeed more compilation issues occurred (including _TINT).

I have not finished 64-bit build because mingw doesn't like tcl build that I already have - you can try to check the branch on your configuration (note that freetype is not yet added to linker).

BenjaminBihler

2016-02-25 16:46

updater   ~0051129

Okay, compilation works now here up to the freetype link error at 75%. :-)

I have tried to add freetype to the linker myself, but I haven't succeeded, I am not familiar enough with CMake and the OCCT build configuration. :-(

kgv

2016-02-25 17:57

developer   ~0051144

Benjamin,

since you are using 64-bit Mingw, maybe you can share / point out where can be found pre-built 3rd-parties for building (e.g. tcl/tk)?

BenjaminBihler

2016-02-25 18:05

updater   ~0051145

If you compile the community edition using oce-win-bundle (https://github.com/QbProg/oce-win-bundle), you have freeimage, freetype and gl2ps compiled by MinGw64. Unfortunately oce-win-bundle does not contain tcl/tk and I have not yet used Draw with MinGw64.

kgv

2016-02-27 15:47

developer   ~0051192

> Unfortunately oce-win-bundle does not contain tcl/tk and
There is no much use for me as far as I can not build Draw Harness ;).
Anyway I have built tcl/tk using Msys2 and OCCT finally builds till the end and starts Draw Harness.

git

2016-02-27 15:48

administrator   ~0051193

Branch CR27197 has been updated by kgv.

SHA-1: 5e8a0c159349326417108d027b6f0b755855d6ca


Detailed log of new commits:

Author: kgv
Date: Sat Feb 27 15:45:27 2016 +0300

    CMake scripts - link FreeType explicitly on Windows as well

git

2016-02-27 22:31

administrator   ~0051194

Branch CR27197 has been updated by kgv.

SHA-1: 5b04686b1891e44de0a01e44b27f5931c4a72d3a


Detailed log of new commits:

Author: kgv
Date: Sat Feb 27 22:31:09 2016 +0300

    genproj - Code::Blocks project file generation improvements

git

2016-02-27 22:35

administrator   ~0051195

Branch CR27197 has been updated forcibly by kgv.

SHA-1: cfa9a224c9befb2c40ad1d64963ad4ebcb74afac

git

2016-02-28 01:43

administrator   ~0051196

Branch CR27197 has been updated by kgv.

SHA-1: ac13af5d63816af7fdcdb6f468b2d7d63e4e3403


Detailed log of new commits:

Author: kgv
Date: Sun Feb 28 01:43:38 2016 +0300

    genproj, cbp - workaround process argument list limits on Windows
    
    by passing object files list by dedicated file.

git

2016-02-28 02:08

administrator   ~0051197

Branch CR27197_1 has been created by kgv.

SHA-1: 48098437c1d8796c695141b4a7656bc072bd8e17


Detailed log of new commits:

Author: kgv
Date: Sun Feb 28 02:07:27 2016 +0300

    0027197: Configuration - fix compilation issues when using mingw
    
    AIS_ColorScale, AIS_Dimension - the protected method DrawText()
    has been renamed to drawText() to avoid name collisions with macros.
    
    _MSC_VER/_WIN32 misuse has been fixed in several places.
    Header <malloc.h> is now included where alloca() is used.
    Draw_Window - dllimport flag has been dropped from inline methods.
    
    TKernel - mandatory dependencies Winspool.lib and Psapi.lib
    are now linked explicitly (instead of msvc-specific pragma syntax).
    
    CMake scripts - the option -std=c++0x has been replaced by -std=gnu++0x
    for mingw to allow extensions (like _wfopen() and others).
    The minimum Windows version has been set to _WIN32_WINNT=0x0501.
    Invalid options "-z defs" and "-lm" have been dropped for mingw.
    Flag --export-all-symbols has been added to CMAKE_SHARED_LINKER_FLAGS
    to workaround missing vtable symbols when using mingw.
    FreeType is now linked explicitly on Windows.
    
    Draw::Load() - "lib" suffix is now prepended on mingw as well.
    
    Drop redundant declaration of _TINT from OSD_WNT_1.hxx.
    NCollection_UtfString::FromLocale() - platform-specific code has been moved to .cxx file.
    Draw_BasicCommands - fixed incorrect mingw64 version macros.
    
    genproj, cbp - added workaround for process argument list limits on Windows.
    TKSTEP linkage is failing on this platform due to too long list of files.
    The list of object files to link is now stored in dedicated file which is passed to gcc.

kgv

2016-02-28 02:09

developer   ~0051198

Patch is ready for review.

git

2016-02-28 20:20

administrator   ~0051199

Branch CR27197_1 has been updated by kgv.

SHA-1: 6d77cf8f16c495c9fc0997cabb8e9040625c1158


Detailed log of new commits:

Author: kgv
Date: Sun Feb 28 20:20:15 2016 +0300

    genproj, osutils:csfList - return libraries without .lib suffix

git

2016-02-28 21:45

administrator   ~0051200

Branch CR27197_1 has been updated by abv.

SHA-1: 98e5d7adaf2e7693f18aec53adc98687f4f05637


Detailed log of new commits:

Author: abv
Date: Sun Feb 28 21:44:46 2016 +0300

    Option "-z defs" removed to avoid problems when building with different configurations of VTK on Linux

abv

2016-02-28 22:18

manager   ~0051201

No remarks, please test

git

2016-02-29 07:51

administrator   ~0051202

Branch CR27197_1 has been updated by abv.

SHA-1: e811fec39c44c53080cb56a0f0b3ef45dae21a40


Detailed log of new commits:

Author: abv
Date: Mon Feb 29 07:51:11 2016 +0300

    Some MinGW-specific compiler warnings (potentially uninitialized vars, use of NULL, parentheses in conditional expressions) are fixed (speculatively)

BenjaminBihler

2016-02-29 14:10

updater   ~0051214

There are no compilation issues anymore with MinGW64 using g++ 5.2.0. Great!!! :-)

git

2016-03-03 06:49

administrator   ~0051335

Branch CR27197_2 has been created by abv.

SHA-1: f31e74ca7d383969939772672ae3af82ff7a171a


Detailed log of new commits:

Author: kgv
Date: Sun Feb 28 02:07:27 2016 +0300

    0027197: Configuration - fix compilation issues when using mingw
    
    AIS_ColorScale, AIS_Dimension - the protected method DrawText()
    has been renamed to drawText() to avoid name collisions with macros.
    
    _MSC_VER/_WIN32 misuse has been fixed in several places.
    Header <malloc.h> is now included where alloca() is used.
    Draw_Window - dllimport flag has been dropped from inline methods.
    
    TKernel - mandatory dependencies Winspool.lib and Psapi.lib
    are now linked explicitly (instead of msvc-specific pragma syntax).
    
    CMake scripts - the option -std=c++0x has been replaced by -std=gnu++0x
    for mingw to allow extensions (like _wfopen() and others).
    The minimum Windows version has been set to _WIN32_WINNT=0x0501.
    Invalid options "-z defs" and "-lm" have been dropped for mingw.
    Flag --export-all-symbols has been added to CMAKE_SHARED_LINKER_FLAGS
    to workaround missing vtable symbols when using mingw.
    FreeType is now linked explicitly on Windows.
    
    Draw::Load() - "lib" suffix is now prepended on mingw as well.
    
    Drop redundant declaration of _TINT from OSD_WNT_1.hxx.
    NCollection_UtfString::FromLocale() - platform-specific code has been moved to .cxx file.
    Draw_BasicCommands - fixed incorrect mingw64 version macros.
    
    genproj, cbp - added workaround for process argument list limits on Windows.
    TKSTEP linkage is failing on this platform due to too long list of files.
    The list of object files to link is now stored in dedicated file which is passed to gcc.
    
    Option "-z defs" removed from CMake linker options to avoid problems when building with different configurations of VTK on Linux
    
    Some MinGW-specific compiler warnings (potentially uninitialized vars, use of NULL, parentheses in conditional expressions) are fixed (speculatively)

git

2016-04-17 12:57

administrator   ~0052786

Branch CR27197 has been deleted by kgv.

SHA-1: ac13af5d63816af7fdcdb6f468b2d7d63e4e3403

git

2016-04-17 12:57

administrator   ~0052787

Branch CR27197_1 has been deleted by kgv.

SHA-1: e811fec39c44c53080cb56a0f0b3ef45dae21a40

git

2016-04-17 13:07

administrator   ~0052812

Branch CR27197_2 has been deleted by kgv.

SHA-1: f31e74ca7d383969939772672ae3af82ff7a171a

Related Changesets

occt: master 7c65581d

2016-02-27 23:07:27

abv


Committer: abv Details Diff
0027197: Configuration - fix compilation issues when using mingw

AIS_ColorScale, AIS_Dimension - the protected method DrawText()
has been renamed to drawText() to avoid name collisions with macros.

_MSC_VER/_WIN32 misuse has been fixed in several places.
Header <malloc.h> is now included where alloca() is used.
Draw_Window - dllimport flag has been dropped from inline methods.

TKernel - mandatory dependencies Winspool.lib and Psapi.lib
are now linked explicitly (instead of msvc-specific pragma syntax).

CMake scripts - the option -std=c++0x has been replaced by -std=gnu++0x
for mingw to allow extensions (like _wfopen() and others).
The minimum Windows version has been set to _WIN32_WINNT=0x0501.
Invalid options "-z defs" and "-lm" have been dropped for mingw.
Flag --export-all-symbols has been added to CMAKE_SHARED_LINKER_FLAGS
to workaround missing vtable symbols when using mingw.
FreeType is now linked explicitly on Windows.

Draw::Load() - "lib" suffix is now prepended on mingw as well.

Drop redundant declaration of _TINT from OSD_WNT_1.hxx.
NCollection_UtfString::FromLocale() - platform-specific code has been moved to .cxx file.
Draw_BasicCommands - fixed incorrect mingw64 version macros.

genproj, cbp - added workaround for process argument list limits on Windows.
TKSTEP linkage is failing on this platform due to too long list of files.
The list of object files to link is now stored in dedicated file which is passed to gcc.

Option "-z defs" removed from CMake linker options to avoid problems when building with different configurations of VTK on Linux

Some MinGW-specific compiler warnings (potentially uninitialized vars, use of NULL, parentheses in conditional expressions) are fixed (speculatively)
Affected Issues
0027197
mod - adm/cmake/occt_csf.cmake Diff File
mod - adm/cmake/occt_defs_flags.cmake Diff File
mod - adm/genproj.tcl Diff File
add - adm/templates/codeblocks.bat Diff File
mod - adm/templates/env.bat Diff File
mod - src/AIS/AIS_AngleDimension.cxx Diff File
mod - src/AIS/AIS_ColorScale.cxx Diff File
mod - src/AIS/AIS_ColorScale.hxx Diff File
mod - src/AIS/AIS_Dimension.cxx Diff File
mod - src/AIS/AIS_Dimension.hxx Diff File
mod - src/BRepAlgo/BRepAlgo_DSAccess.cxx Diff File
mod - src/BSplCLib/BSplCLib.cxx Diff File
mod - src/CDF/CDF_FWOSDriver.cxx Diff File
mod - src/Dico/Dico_Dictionary.gxx Diff File
mod - src/Draw/CommandWindow.cxx Diff File
mod - src/Draw/Draw.cxx Diff File
mod - src/Draw/DrawRessource.h Diff File
mod - src/Draw/Draw_BasicCommands.cxx Diff File
mod - src/Draw/Draw_Interpretor.cxx Diff File
mod - src/Draw/Draw_Main.cxx Diff File
mod - src/Draw/Draw_Window.cxx Diff File
mod - src/Draw/Draw_Window.hxx Diff File
mod - src/DrawTrSurf/DrawTrSurf.cxx Diff File
mod - src/DrawTrSurf/DrawTrSurf_Point.cxx Diff File
mod - src/FSD/FSD_File.cxx Diff File
mod - src/HLRBRep/HLRBRep_PolyAlgo.cxx Diff File
mod - src/IntAna/IntAna_Curve.cxx Diff File
mod - src/MeshVS/MeshVS_MeshPrsBuilder.cxx Diff File
mod - src/Message/Message_PrinterOStream.cxx Diff File
mod - src/MoniTool/MoniTool_TypedValue.cxx Diff File
mod - src/NCollection/FILES Diff File
add - src/NCollection/NCollection_UtfString.cxx Diff File
mod - src/NCollection/NCollection_UtfString.lxx Diff File
mod - src/NCollection/NCollection_WinHeapAllocator.cxx Diff File
mod - src/OpenGl/OpenGl_Context.cxx Diff File
mod - src/OpenGl/OpenGl_ShaderObject.cxx Diff File
mod - src/OpenGl/OpenGl_ShaderProgram.cxx Diff File
mod - src/OSD/OSD_DirectoryIterator.cxx Diff File
mod - src/OSD/OSD_File.cxx Diff File
mod - src/OSD/OSD_File.hxx Diff File
mod - src/OSD/OSD_FileIterator.cxx Diff File
mod - src/OSD/OSD_Host.cxx Diff File
mod - src/OSD/OSD_MemInfo.cxx Diff File
mod - src/OSD/OSD_OpenFile.cxx Diff File
mod - src/OSD/OSD_Path.cxx Diff File
mod - src/OSD/OSD_Process.cxx Diff File
mod - src/OSD/OSD_signal_WNT.cxx Diff File
mod - src/OSD/OSD_WNT_1.hxx Diff File
mod - src/PCDM/PCDM_ReferenceIterator.cxx Diff File
mod - src/QABugs/QABugs_11.cxx Diff File
mod - src/Standard/Standard.cxx Diff File
mod - src/Standard/Standard_Assert.hxx Diff File
mod - src/Standard/Standard_CLocaleSentry.cxx Diff File
mod - src/Standard/Standard_CLocaleSentry.hxx Diff File
mod - src/Standard/Standard_CString.cxx Diff File
mod - src/Standard/Standard_values.h Diff File
mod - src/TCollection/TCollection_AsciiString.cxx Diff File
mod - src/TCollection/TCollection_ExtendedString.cxx Diff File
mod - src/TKD3DHost/EXTERNLIB Diff File
mod - src/TKernel/EXTERNLIB Diff File
mod - src/TopOpeBRepBuild/TopOpeBRepBuild_GIter.cxx Diff File
mod - src/TopOpeBRepBuild/TopOpeBRepBuild_GTopo.cxx Diff File
mod - src/TopOpeBRepDS/TopOpeBRepDS_EXPORT.cxx Diff File
mod - src/V3d/V3d_View_Print.cxx Diff File
mod - src/ViewerTest/ViewerTest_ObjectCommands.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
mod - src/WNT/WNT_WClass.cxx Diff File
mod - src/WNT/WNT_Window.cxx Diff File
mod - src/XmlLDrivers/XmlLDrivers_DocumentRetrievalDriver.cxx Diff File

Issue History

Date Modified Username Field Change
2016-02-22 21:49 kgv New Issue
2016-02-22 21:49 kgv Assigned To => bugmaster
2016-02-22 21:49 kgv Assigned To bugmaster => kgv
2016-02-22 21:49 kgv Status new => assigned
2016-02-22 22:09 kgv Relationship added related to 0027196
2016-02-22 22:12 git Note Added: 0051062
2016-02-23 12:04 BenjaminBihler Note Added: 0051063
2016-02-23 12:18 BenjaminBihler Note Added: 0051064
2016-02-23 15:38 git Note Added: 0051065
2016-02-23 15:46 kgv File Added: mingw_warnings_gcc51.txt
2016-02-23 19:44 git Note Added: 0051066
2016-02-23 19:50 kgv Note Added: 0051067
2016-02-25 16:46 BenjaminBihler Note Added: 0051129
2016-02-25 17:57 kgv Note Added: 0051144
2016-02-25 18:05 BenjaminBihler Note Added: 0051145
2016-02-27 15:47 kgv Note Added: 0051192
2016-02-27 15:48 git Note Added: 0051193
2016-02-27 22:31 git Note Added: 0051194
2016-02-27 22:35 git Note Added: 0051195
2016-02-28 01:43 git Note Added: 0051196
2016-02-28 02:08 git Note Added: 0051197
2016-02-28 02:09 kgv Note Added: 0051198
2016-02-28 02:09 kgv Assigned To kgv => abv
2016-02-28 02:09 kgv Status assigned => resolved
2016-02-28 20:20 git Note Added: 0051199
2016-02-28 21:45 git Note Added: 0051200
2016-02-28 22:18 abv Note Added: 0051201
2016-02-28 22:18 abv Assigned To abv => bugmaster
2016-02-28 22:18 abv Status resolved => reviewed
2016-02-28 22:18 abv Target Version 7.1.0 => 7.0.0
2016-02-29 07:51 git Note Added: 0051202
2016-02-29 14:10 BenjaminBihler Note Added: 0051214
2016-03-03 06:49 git Note Added: 0051335
2016-03-04 16:52 abv Changeset attached => occt master 7c65581d
2016-03-04 16:52 abv Assigned To bugmaster => abv
2016-03-04 16:52 abv Status reviewed => verified
2016-03-04 16:52 abv Resolution open => fixed
2016-03-05 15:48 kgv Relationship added parent of 0027232
2016-04-17 12:57 git Note Added: 0052786
2016-04-17 12:57 git Note Added: 0052787
2016-04-17 13:07 git Note Added: 0052812
2016-04-20 15:43 aiv Fixed in Version => 7.0.0
2016-04-20 15:49 aiv Status verified => closed
2017-11-14 10:57 kgv Relationship added related to 0029317
2018-09-06 20:02 kgv Relationship added related to 0030091
2019-03-27 14:14 kgv Relationship added parent of 0030609
2020-06-11 08:35 kgv Relationship added parent of 0031606