I am trying running c++ file on plugin IOS (not ios app). First I create cpp file
Greeting.cpp
#include "Greeting.hpp"
Greeting::Greeting() {
greeting = "Hello C++!";
}
std::string Greeting::greet() {
return greeting;
}
Then I create Greeting.hpp
#ifndef Greeting_hpp
#define Greeting_hpp
#include <stdio.h>
#include <string>
class Greeting {
std::string greeting;
public:
Greeting();
std::string greet();
};
#endif /* Greeting_hpp */
Then I import it into object c file
AgoraRtcEnginePlugin.m
#import "Greeting.hpp"
NSString* newTitle = [NSString stringWithCString:greeting.greet().c_str() encoding:[NSString defaultCStringEncoding]];
result(newTitle);
But when I complile It always throws errors
/agora-flutter-sdk/ios/Classes/Greeting.hpp:13:10: fatal error: 'string' file not found
#include <string>