I have successfully compiled the IfcOpenShell 0.7 on my Ubuntu 20.04. I was able to parse my IFC2x3 file and now I would like to use ifcgeom to extract global coordinate. But when I include the ifcgeom.h file I always get the following Error:
That error occurs for all schemas in used in "/ifcgeom_schema_agnostic/Kernel.h". Can anyone help me?
What do I do wrong?
My program reads a ifc file and gets information about IfcWindow, it looks like this:
#define IfcSchema Ifc2x3#include<string>#include<iostream>#include"IfcFile.h"#include"Ifc2x3.h"#include"IfcGeom.h"/*#include <gp_Pnt.hxx> Diese Datei wird nicht gefunden, da OpenCascade an einem anderen Ort liegt ....*/intmain(intargc,char**argv){if(argc!=2){std::cout<<"usage: IfcParseExamples <filename.ifc>"<<std::endl;return1;}std::cout<<"Das hier ist ein IfcParse-Test mit der IfcOpenShell"<<std::endl;std::stringpath=argv[1];// oder "/home/mathias/VSCode/Projects/IfcOpenShell_tests/IfcParse/" IfcParse::IfcFilefile(argv[1]);if(!file.good()){std::cout<<"Unable to parse .ifc file"<<std::endl;//return 1;}IfcSchema::IfcBuildingElement::list::ptrelements=file.instances_by_type<IfcSchema::IfcBuildingElement>();std::cout<<"Found "<<elements->size()<<" elements in "<<path<<":"<<std::endl;for(IfcSchema::IfcBuildingElement::list::itit=elements->begin();it!=elements->end();++it){constIfcSchema::IfcBuildingElement*element=*it;std::cout<<element->data().toString()<<std::endl;constIfcSchema::IfcWindow*window;if((window=element->as<IfcSchema::IfcWindow>())!=0){if(window->OverallWidth()&&window->OverallHeight()){constdoublearea=*window->OverallWidth()**window->OverallHeight();std::cout<<"The area of this window is "<<area<<std::endl;}}}//IfcGeom::IteratorSettings settings;//settings.set(IfcGeom::IteratorSettings::USE_WORLD_COORDS, true);return0;}
I compile my program with cmake. The CmakeList looks like this:
With all the machinery to supply multiple schema versions at runtime, it hasn't become easier to build 3rd party C++ apps using IfcOpenShell. If you have ideas on on streamlining/documenting this process we'd be happy to hear your feedback. You're missing the defines set here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/cmake/CMakeLists.txt#L648-L662
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you very much for your answer. Adding the marked lines helped to solve the problems partially. But still I receive the following error:
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function GeomAdaptor_Surface::operator delete(void*)':
/usr/include/opencascade/GeomAdaptor_Surface.hxx:65: undefined reference toStandard::Free(void)'
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function BRepAdaptor_Surface::operator delete(void*)':
/usr/include/opencascade/BRepAdaptor_Surface.hxx:71: undefined reference toStandard::Free(void)'
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function BRepAdaptor_Surface::UContinuity() const':
/usr/include/opencascade/BRepAdaptor_Surface.lxx:64: undefined reference toGeomAdaptor_Surface::UContinuity() const'
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function BRepAdaptor_Surface::VContinuity() const':
/usr/include/opencascade/BRepAdaptor_Surface.lxx:74: undefined reference toGeomAdaptor_Surface::VContinuity() const'
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function BRepAdaptor_Surface::NbUIntervals(GeomAbs_Shape) const':
/usr/include/opencascade/BRepAdaptor_Surface.lxx:85: undefined reference toGeomAdaptor_Surface::NbUIntervals(GeomAbs_Shape) const'
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function BRepAdaptor_Surface::NbVIntervals(GeomAbs_Shape) const':
/usr/include/opencascade/BRepAdaptor_Surface.lxx:96: undefined reference toGeomAdaptor_Surface::NbVIntervals(GeomAbs_Shape) const'
....
That means OpenCascade is not linked correctly, right?
And what I think would be great to have to streamline the whole development process: It would be great if IfcOpenShell would provide basic documentation about dependencies on other software versions. Based on that, a sample project for developing an own applications would also be helpful.
Probably a FindIfcOpenShell.cmake would help most devs to easily use IfcOpenShell.
Best regards,
Mathias
Last edit: Mathias Worm 2022-12-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I have successfully compiled the IfcOpenShell 0.7 on my Ubuntu 20.04. I was able to parse my IFC2x3 file and now I would like to use ifcgeom to extract global coordinate. But when I include the ifcgeom.h file I always get the following Error:
That error occurs for all schemas in used in "/ifcgeom_schema_agnostic/Kernel.h". Can anyone help me?
What do I do wrong?
My program reads a ifc file and gets information about IfcWindow, it looks like this:
I compile my program with cmake. The CmakeList looks like this:
I really hope anyone can help.
Best regards,
Mathias
With all the machinery to supply multiple schema versions at runtime, it hasn't become easier to build 3rd party C++ apps using IfcOpenShell. If you have ideas on on streamlining/documenting this process we'd be happy to hear your feedback. You're missing the defines set here: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/cmake/CMakeLists.txt#L648-L662
Hello Thomas,
thank you very much for your answer. Adding the marked lines helped to solve the problems partially. But still I receive the following error:
/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
GeomAdaptor_Surface::operator delete(void*)': /usr/include/opencascade/GeomAdaptor_Surface.hxx:65: undefined reference to
Standard::Free(void)'/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
BRepAdaptor_Surface::operator delete(void*)': /usr/include/opencascade/BRepAdaptor_Surface.hxx:71: undefined reference to
Standard::Free(void)'/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
BRepAdaptor_Surface::UContinuity() const': /usr/include/opencascade/BRepAdaptor_Surface.lxx:64: undefined reference to
GeomAdaptor_Surface::UContinuity() const'/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
BRepAdaptor_Surface::VContinuity() const': /usr/include/opencascade/BRepAdaptor_Surface.lxx:74: undefined reference to
GeomAdaptor_Surface::VContinuity() const'/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
BRepAdaptor_Surface::NbUIntervals(GeomAbs_Shape) const': /usr/include/opencascade/BRepAdaptor_Surface.lxx:85: undefined reference to
GeomAdaptor_Surface::NbUIntervals(GeomAbs_Shape) const'/usr/bin/ld: CMakeFiles/ReadIfcFile.dir/main.cpp.o: in function
BRepAdaptor_Surface::NbVIntervals(GeomAbs_Shape) const': /usr/include/opencascade/BRepAdaptor_Surface.lxx:96: undefined reference to
GeomAdaptor_Surface::NbVIntervals(GeomAbs_Shape) const'....
That means OpenCascade is not linked correctly, right?
And what I think would be great to have to streamline the whole development process: It would be great if IfcOpenShell would provide basic documentation about dependencies on other software versions. Based on that, a sample project for developing an own applications would also be helpful.
Probably a FindIfcOpenShell.cmake would help most devs to easily use IfcOpenShell.
Best regards,
Mathias
Last edit: Mathias Worm 2022-12-05