<分区>
更新到 Sierra 后,我将我的 Xcode 从 7.2.1 更新到 Xcode 8。所以问题可能只是通过更新 Xcode 发生的。我降级回 7.2.1,但仍然遇到同样的问题。
这是我在编译C++程序时遇到的错误
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:4:11: warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:4:11: note: change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:54:11: warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
/var/folders/cj/1h3_84h56c9bgzt_ryhpf4940000gn/T//ccgjxtCM.s:54:11: note: change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
程序仍在运行,但会显示此消息。即使代码中唯一的东西是我创建的名为 graph 的类,并且我有这样的代码,也会出现错误。
void explore(Graph & G, int x)
{
Node* nodePtr = &G.changeNode(x);
}
我尝试在命令行中执行此操作,但没有成功
sudo xcode-select -s /Library/Developer/CommandLineTools
这是我在 Sublime Text 中使用的构建,但即使使用不是 c++11 的其他 c++ 编译器,我也会遇到同样的错误。错误也出现在命令行上。
{
"shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"shell_cmd": "g++ -std=c++11 \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
我认为唯一可行的方法是使用我在该站点上的某些线程上看到的补丁
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151012/305992.html
我不知道如何使用它们或如何运行。