How to use standard C ++ libraries in xcode?

I have a new empty xcode project. This gives me the error "There is no such file or directory" when I try to import some C ++ libraries, such as <iostream>, <string>and<map>

What do I need to do to import C ++ libraries into xcode so that I can call their functions in objective-c?

+3
source share
1 answer

If you are just trying to write C ++ code in Xcode instead of calling C ++ libraries in an objectiveC project, you can create a C ++ project. I just created a new project using the "Command Line Tool" template and selected C ++ as the language.

Then I could add the following lines without a compiler complaint.

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>

std ++, std::

int main (int argc, const char * argv[])
{
    std::cout << "Hello World!";

    return 0;
}

, std:: Xcode...

+3

Source: https://habr.com/ru/post/1795365/


All Articles