Can i use c++ library with c library in swift app project
Hello. I want to use a C++ library in my Swift app project.
First, our company has an internal solution library.
When built, it generates a Static Library in '.a' format, and we use it by connecting the library's Header to the App_Bridging_Header.
There's no problem with this part.
However, the new feature now includes C++. It also generates a Static Library in '.a' format.
So, I tried to use the same method and created an App_Bridging_Header. But an error occurs, and I can't proceed.
The first error occurs in the library file:
'iostream' file not found
The second error occurs in the App_Bridging_Header:
failed to emit precompiled header '/Users/kimjitae/Library/Developer/Xcode/DerivedData/ddddd-glmnoqrwdrgarrhjulxjmalpyikr/Build/Intermediates.noindex/PrecompiledHeaders/ddddd-Bridging-Header-swift_3O89L0OXZ0CPD-clang_188AW1HK8F0Q3.pch' for bridging header '/Users/kimjitae/Desktop/enf4/ddddd/ddddd/ddddd-Bridging-Header.h'
Our library is developed in C++ using Xcode, and there's no problem when we run and build just the library project.
The build succeeds, and the '.a' file is generated correctly. However, when we try to connect it with the app, the above problems occur.
Could there be a problem because we also need to use the existing C library alongside this?
The build is successful in an app project created with Objective-C.