gpt4 book ai didi

Xcode : Fontconfig error: Cannot load default config file

转载 作者:行者123 更新时间:2023-12-03 17:20:44 25 4
gpt4 key购买 nike

在沙盒 Mac 应用程序中,我使用静态构建的代码签名 ffmpeg。 ffmpeg 需要 fonts.conf 文件。所以我正在这样做

[[NSFileManager defaultManager] createDirectoryAtPath:[NSHomeDirectory() stringByAppendingString:@"/fonts/"] withIntermediateDirectories:YES attributes:nil error:nil];
[[NSFileManager defaultManager] copyItemAtPath:[[NSBundle mainBundle] pathForResource:@"fonts" ofType:@"conf"] toPath:[NSHomeDirectory() stringByAppendingString:@"/fonts/fonts.conf"] error:NULL];

NSString *fontconfigFile= [NSHomeDirectory() stringByAppendingString:@"/fonts/fonts.conf"];
NSString *fontconfigPath= [NSHomeDirectory() stringByAppendingString:@"/fonts/"];

setenv("FONTCONFIG_FILE", [fontconfigFile UTF8String], 0);
setenv("FONTCONFIG_PATH", [fontconfigPath UTF8String], 0);

但是当我这样做时 ffmpeg 无法运行。我究竟做错了什么?我希望 Mac 应用程序在 10.9 和 10.10 中运行。

问题是我如何指示 xcode 在我的 mac 应用程序运行时从哪里获取 fonts.conf?

最佳答案

不使用 NSString 和 stringByAppendingPathComponent 的动机是什么?甚至 NSURL?您是否使用调试器单步查看错误是因为文件未复制还是 setenv 的问题?

关于Xcode : Fontconfig error: Cannot load default config file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28988533/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com