Call inaccessible function "system": not available in iOS

I am new to cocos2d-x and when compiling my project I get this error.

Call inaccessible function 'system': not available in iOS

I see that this call is no longer applicable, but what can I use to replace it? Any insight would be appreciated!

bool FileUtils::removeDirectory(const std::string& path)
{
#if !defined(CC_TARGET_OS_TVOS)
    std::string command = "rm -r ";
    // Path may include space.
    command += "\"" + path + "\"";
    if (system(command.c_str()) >= 0) /*System Call Error/Not Availible*/
        return true;
    else
        return false;
 #else
    return false;
#endif
}
+4
source share
2 answers
Function

systemnot available in iOS 11, there is an accepted PR for the same problem .

Now we use nftwinstead system. Update the source code using the v3repos branch .

+2
source

iOS 11 , 9 cocos2d-x 3.16

if (command.size() >= 0)

+1

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


All Articles