I created two single view iOS projects from Xcode. The first one in Swift and the second one in Objective-C.
In those two projects, I add both Test.cpp / Test.hpp files which only include C++ library. Of course, for the Swift project only, I have to create a Bridging Header to import this file.
Test.hpp file looks like this:
#ifndef TestCpp_hpp
#define TestCpp_hpp
#include <stdio.h>
#include <cstdlib>
#endif /* TestCpp_hpp */
The issue I have is that the Objective-C project is building successfully, meanwhile the Swift project fails to find the cstdlib
C++ library.
I checked the compilation command and the Swift project uses swift
to build. The Objective-C project uses clang
.
I tried to change the C++ Language Dialect
and C++ Standard Library
in the build settings but nothing is working.
Is there some special setup to do in order to be able to build the Swift project?