Compile ifcplusplus emit error C1002!
Compile ifcplusplus library using vs2017 throws out the C1002 error:
e:\prjs\ifcplusplus-master\ifcplusplus\src\ifcpp\writer\writerstep.cpp : fatal error C1002: compiler is out of heap space in pass 2 .... I think my physical memory is enough:12G. Please tell me the reason of the error ,and how to solve it.
IFC++ uses a large number of classes, as it directly maps them to defined entities in the IFC specification. The IFC writer (writerstep.cpp) basically uses all of them, resulting in a really large compilation unit, which uses a lot of RAM. Without redesigning parts of the library this probably can't be changed.
Microsoft seems to ship some version of Visual Studio with 32 bit compilers, independent of what kind of output they produce (for example: My VS2015 express has a 32 bit compiler which produces 64-Bit executables and dlls). This means they can only use a maximum of 3 GB of memory before they crash/exit with error. (Windows puts certain limits on 32 bit processes, which means they can only use 2GB or 3GB RAM from the theoretical maximum of 4GB)
You could try if you have another version of Visual Studio which has native 64 bit compilers, or maybe it even helps by changing a few of the compilation flags (I had to disable Whole Program Optimization)
In my case building, 32-bit version helped. 64-bit doesn't compile. Here you will find some more info about this issue: https://docs.microsoft.com/en-us/visualstudio/ide/visual-studio-performance-tips-and-tricks?view=vs-2017