Skip to content

Call to unavailable function 'system': not available on iOS #17907

Closed
@maksg

Description

@maksg

cocos2d-x 3.15.1
Xcode 9 and iOS 11

In the newest Xcode this error shows up when compiling for iOS in platform/CCFileUtils.cpp, line 1429:
Call to unavailable function 'system': not available on iOS

Activity

mars3142

mars3142 commented on Jun 7, 2017

@mars3142
Contributor

It's in FileUtils::removeDirectory(const std::string& path) and the deprecation text for system is -> Use posix_spawn APIs instead.

minggo

minggo commented on Jun 8, 2017

@minggo
Contributor

Xcode 9 is in beta version.

minggo

minggo commented on Jun 8, 2017

@minggo
Contributor

Use posix_spawn APIs instead.

@mars3142 could you please describe it in detail?

mars3142

mars3142 commented on Jun 8, 2017

@mars3142
Contributor

Right, but the system call is deprecated for iPhone since long time ago.

mars3142

mars3142 commented on Jun 8, 2017

@mars3142
Contributor

@minggo I only jumped into the definition of system in Xcode 9 (Beta with iOS 11), which is in stdlib.h

__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable")
__API_AVAILABLE(macos(10.0)) __IOS_PROHIBITED
__WATCHOS_PROHIBITED __TVOS_PROHIBITED
int	 system(const char *) __DARWIN_ALIAS_C(system);

In Xcode 8 (iOS 10.12) showed nearly the same:

__swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable") __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_NA,__IPHONE_2_0,__IPHONE_8_0, "Use posix_spawn APIs instead.") __WATCHOS_PROHIBITED __TVOS_PROHIBITED int system(const char *) __DARWIN_ALIAS_C(system);

This is what I see and that way I thought posix_spawn will be the solution.

minggo

minggo commented on Jun 8, 2017

@minggo
Contributor

Ok, but i think we should use nftw as mentioned in the ticket.

added this to the 3.16 milestone on Jun 8, 2017
self-assigned this
on Jun 8, 2017
minggo

minggo commented on Jun 12, 2017

@minggo
Contributor

fixed in #17921

erebar

erebar commented on Jul 4, 2018

@erebar

I don't know why you say FIXED when it's NOT. I just downloaded v17 and the thing is still there.

minggo

minggo commented on Jul 5, 2018

@minggo
Contributor

Why did you say it is not fixed? How did you test?

erebar

erebar commented on Jul 5, 2018

@erebar

I downloaded v3.17 from here: http://cocos2d-x.org/download
And got that same "'system': not available on iOS" when I tried building a game that was using version v3.10 before.

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @mars3142@minggo@erebar@slackmoehrle@maksg

      Issue actions

        Call to unavailable function 'system': not available on iOS · Issue #17907 · cocos2d/cocos2d-x