警告:自更新到 Mac OSX Sierra 以来,第 "__textcoal_nt" 节已弃用
warning: section "__textcoal_nt" is deprecate since updating to Mac OSX Sierra
更新到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++编译器,也不是c++11,我得到同样的错误。命令行也出现错误
{
"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
我不知道如何使用它们或运行。
这里的答案:https://solarianprogrammer.com/2016/09/22/compiling-gcc-6-macos/
你可以安全地忽略所有这些警告,这些警告与GCC生成的汇编代码有关,与你的c++代码无关。
不幸的是,在这个时候,没有办法指示GCC不要使用__textcoal_nt,或者沉默上述警告。一个快速而不太实用的解决方法是用以下方式过滤编译器的输出:
g++-6 main.cpp -o main 2>&1 >/dev/null | grep -v -e '^/var/folders/*' -e '^[[:space:]]*.section' -e '^[[:space:]]*^[[:space:]]*~*'
相关文章:
- 几个 Nt 函数在 Windows 7 x32 上返回STATUS_WAIT_0
- NT状态未在此范围内声明
- 在C/C 中使用检查功能的Windows NT命令行代码循环
- 如何在Windows NT中获取线程的动态优先级
- NT内核记录器会话日志未创建
- Windows NT 二进制可执行文件内部常量字符串编码
- 从 ntdll 调用 Nt 函数.dll在 Win32 环境中,C++
- 当父NT服务被终止/崩溃时,终止子进程
- 在NT文件系统上的非常小的文件上FSCTL_GET_RETRIEVAL_POINTERS失败
- 如何从使用 NT 的 QueueUserWorkItem 创建的工作线程调用 COM?
- 用户模式应用的Nt* api头文件
- 拒绝访问nt权限本地服务
- 以用户身份运行的创建进程:"NT AUTHORITY/Network Service"不知道凭据?