New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
maksg opened this Issue Jun 7, 2017 · 12 comments

Comments

Projects
None yet
5 participants
@maksg

maksg commented Jun 7, 2017

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

@mars3142

This comment has been minimized.

Contributor

mars3142 commented Jun 7, 2017

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

@minggo

This comment has been minimized.

Contributor

minggo commented Jun 8, 2017

Xcode 9 is in beta version.

@minggo minggo added the platform:ios label Jun 8, 2017

@minggo

This comment has been minimized.

Contributor

minggo commented Jun 8, 2017

Use posix_spawn APIs instead.

@mars3142 could you please describe it in detail?

@mars3142

This comment has been minimized.

Contributor

mars3142 commented Jun 8, 2017

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

@mars3142

This comment has been minimized.

Contributor

mars3142 commented Jun 8, 2017

@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

This comment has been minimized.

Contributor

minggo commented Jun 8, 2017

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

@minggo minggo added this to the 3.16 milestone Jun 8, 2017

@minggo minggo self-assigned this Jun 8, 2017

@minggo

This comment has been minimized.

Contributor

minggo commented Jun 12, 2017

fixed in #17921

@minggo minggo closed this Jun 15, 2017

@erebar

This comment has been minimized.

erebar commented Jul 4, 2018

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

@minggo

This comment has been minimized.

Contributor

minggo commented Jul 5, 2018

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

@erebar

This comment has been minimized.

erebar commented Jul 5, 2018

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.

@minggo

This comment has been minimized.

Contributor

minggo commented Jul 6, 2018

Can you reproduce it with cpp-empty-test? What device did you test on?

@slackmoehrle

This comment has been minimized.

Contributor

slackmoehrle commented Jul 6, 2018

@erebar can you post a picture, please.

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