我正在使用Nvim尝试并开发一个Mac应用程序。我刚刚导入AppKit.h来实例化一个sharedApplication。
我正在使用coc-clangd进行自动完成。当我导入AppKit.h时,我得到了以下错误。
In included file: function does not return NSString
[clang: format_attribute_result_not]

守则:
#include <stdio.h>
#include <AppKit/AppKit.h>
int main(int argc, const char * argv[])
{
printf("Hello world");
return 0;
}我还应该提到,代码编译得很好。我已经尝试了下面的编译命令,它们都起作用了。
clang -framework AppKit -o a osx_main.mmclang -Wall -o a osx_main.mm发布于 2022-08-12 11:02:01
您应该选择命令行工具版本,Xcode▶Preferences▶Location▶command line tool▶,然后选择适当的命令行工具版本。
https://stackoverflow.com/questions/73273392
复制相似问题