Replies: 1 comment 2 replies
-
It's likely that your not compiling with the correct C++ specification version. If you use CMake (which you can use to generate the XCode project files) you get the correct configuration (which is C++14) https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/cmake/CMakeLists.txt#L21-L22
I agree this is likely the right approach to deal with LGPL license compliance. Language interoperability like this is not necessarily trivial though and requires a fairly good understanding of the compilation and linking process. The most straight forward way possible is to define your own C (so not C++) interface to the library functionality you use and compile that into a DLL. C doesn't use name mangling because it doesn't support polymorphism. See a guide like this https://www.swiftprogrammer.info/swift_call_cpp.html I would also recommend at least investigating another approach of doing the model conversion online. That way you're not distributing LGPL code (because it doesn't leave the server) so you're not really bound by license complexity. And you also don't have to fight with fairly complex language interoperability issues. There are likely cases anyway where an IFC model is so large and complex that it can't be processed on mobile hardware. |
Beta Was this translation helpful? Give feedback.
-
Hey, i am currently building an ifc viewer on mobile (iOS to be specific) and it is going good so far. But now i have ran into some issues. See, when i want to open a ifc file from iOS (Swift) i need to convert the file to something like dae or another file format so that i can render it with SceneKit. The problem is that i really have problems with compiling. I get errors like the following:
/Users/myname/IfcOpenShell-0.7.0/src/ifcconvert/../serializers/../ifcgeom_schema_agnostic/../ifcparse/../ifcparse/IfcParse.h:157:32: error: definition or redeclaration of 'string' not allowed inside a function static my_thread_local std::string s;
or
/Users/myname/IfcOpenShell-0.7.0/src/ifcconvert/../serializers/../ifcgeom_schema_agnostic/../ifcparse/IfcFile.h:166:19: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool batch_mode_ = false;
and many more...
This is really stopping me. I haven't found something on the internet for this issue. Also even if i compile to a dylib (which is necessary because of the license of IfcOpenShell) i don't know how to call the functions of IfcConvert (e.g. create a Swift Binding for the library).
Help would be really much appreciated. I really don't know how to continue from here...
-Julius
Beta Was this translation helpful? Give feedback.
All reactions