g++ 4.6 在 mac os x 上调用 ld 时在 -F 和路径之间添加一个空格
我为 Mac OS X 编译了 g++ 4.6。它工作正常,除非我使用 -F
选项,在这种情况下我会收到错误:
ld: -F must be immediately followed by a directory path (no space)
在 g++ 命令行上,我确保之间没有空格-F
和文件夹,但是使用 -v
选项启动 g++,我确实可以看到 g++ 正在调用 ld
在后面添加一个空格-F
选项。我能做些什么?
我相当确定我以前遇到过这个问题,但设法解决了它。我只是不记得该怎么做了。
I compiled g++ 4.6 for Mac OS X. It works fine, unless I use the -F
option, in which case I get the error:
ld: -F must be immediately followed by a directory path (no space)
On the g++ command line, I made sure there is no space between the -F
and the folder, but starting g++ with the -v
option, I could indeed see that g++ is calling ld
adding a space after the -F
option. What can I do?
I am fairly sure I had the problem before but managed to solve it. I just don't remember how to do it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题在于选项 -F 未能通过 gcc 语言验证 - 因为 gcc 告诉该选项对于语言 DRIVER (0x4000) 无效。
虽然这对我来说仍然很奇怪,但作为一个古怪且有效的补丁我已经改变了
gcc/c-family/c.opt 并向该选项添加了驱动程序语言,以便它显示为:
对于任何更好的解决方案,应该在初始化选项的地方调试 gcc.c 和 opts-common.c 文件(因为我已经停在decode_cmdline_option()处,它检查“if (!option_ok_for_language (option, lang_mask))”)
The problem is here that option -F fails the gcc language validation - as gcc tells that the option is not valid for the language DRIVER (0x4000).
while this is still strange to me, as a quirky and working patch I have changed
gcc/c-family/c.opt and added Driver language to the option so that it reads:
For any better solution one should debug gcc.c and opts-common.c files where it initialises the options (as I have stopped at decode_cmdline_option() where it checks "if (!option_ok_for_language (option, lang_mask))" )
您可以使用
You can use