g++:错误:无法识别的选项‘--end-group’
我已经使用 ubuntu 10.10 作为我的开发 PC 有一段时间了。我的代码是使用 g++ 版本 4.4.5 构建的,没有错误。最近我将系统升级到 11.10,其中包含 g++ 版本 4.6.1 现在,使用这个编译器,当我尝试构建同一段代码时,我收到此错误:
g++: error: unrecognized option ‘--end-group’
Make file 行,抛出此错误的是:
$(TARGET): $(OBJS)
g++ $(LDFLAGS) $^ $ -Wl,--start-group $(ARCHIVE_LIBS) --end-group -o $(TARGET)
cp -f $(TARGET) ../../../bin/
Can some please throw some light on this?我用谷歌搜索过,但没有得到任何线索?
谢谢和问候, 苏维克
I had been using ubuntu 10.10 for quite some time as my development PC. My code was to build without error with g++ version 4.4.5. Recently I had upgraded my system to 11.10 which has come with g++ version 4.6.1
Now , using this compiler, when I am trying to build the same piece of code, I am getting this error:
g++: error: unrecognized option ‘--end-group’
The Make file line, where this error is thrown is:
$(TARGET): $(OBJS)
g++ $(LDFLAGS) $^ $ -Wl,--start-group $(ARCHIVE_LIBS) --end-group -o $(TARGET)
cp -f $(TARGET) ../../../bin/
Can some please throw some light on this? I had googled but I did not get any clue?
Thanks and Regards,
Souvik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
--end-group
是一个链接器标志,因此您应该在它前面加上-Wl
前缀,即我不确定为什么这之前有效。
--end-group
is a linker flag so you should prefix it with-Wl
, i.e.I am not sure why this worked before.