Open-Infra-Platform icon indicating copy to clipboard operation
Open-Infra-Platform copied to clipboard

[BUG] IFC4 does not compile

Open christophKaiser opened this issue 3 years ago • 1 comments

Describe the bug The project OpenInfraPlatform.Core does not compile with IFC4. In the Output, the first error message is:

(...)\Core\src\IfcGeometryConverter\PlacementConverter.h(586,1): error C2146: syntax error: missing '>' before identifier 'IfcLinearPlacement'

To Reproduce Steps to reproduce the behavior:

  1. In CMake, select the option EARLYBINDING_WITH_IFC4
  2. Compile all steps according to SetupHelp.md
  3. The compiler error will appear during the project OpenInfraPlatform.Core

Expected behavior Even with IFC4, I would expect the solution to compile.

CMake configuration If applicable, list any special configurations you have selected in CMake.

  • EARLYBINDING_WITH_IFC4: selected

Additional context According to the IFC documentation, the entity IfcLinearPlacement was introduced with IFC4x1 RC3 (link to documentation). Therefore, it will be some kind of undefined type in IFC4.

Probably, the option EARLYBINDING_WITH_IFC2x3 for IFC2x3 will bring up similar issues.

I was albe to find some kind of fix or work around with the if-condition

#if !(defined(OIP_MODULE_EARLYBINDING_IFC2X3) || defined(OIP_MODULE_EARLYBINDING_IFC4))
  // some source code with IfcLinearPlacement
#endif

However, after IfcLinearPlacement was excluded from the code for IFC4, other IFC entities come up with the same problem. Currently, on my list are:

  • IfcLinearPlacement
  • IfcDistanceExpression
  • IfcPointByDistanceExpression
  • IfcAxis2PlacementLinear
  • IfcOrientationExpression
  • IfcPositioningElement
  • IfcOffsetCurve
  • IfcSectionedSolid
  • IfcSectionedSolidHorizontal

At some point, the side effects on the entire namespace IfcGeometryConverter were to big to push a fast fix.

christophKaiser avatar Mar 13 '22 21:03 christophKaiser

See #334 as well.

pjanck avatar Mar 14 '22 12:03 pjanck