g++:错误:无法识别的选项‘--end-group’

发布于 2024-12-22 17:21:06 字数 482 浏览 1 评论 0原文

我已经使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我一直都在从未离去 2024-12-29 17:21:06

--end-group 是一个链接器标志,因此您应该在它前面加上 -Wl 前缀,即

g++ $(LDFLAGS) $^ $ -Wl,--start-group $(ARCHIVE_LIBS) -Wl,--end-group -o $(TARGET)

我不确定为什么这之前有效。

--end-group is a linker flag so you should prefix it with -Wl, i.e.

g++ $(LDFLAGS) $^ $ -Wl,--start-group $(ARCHIVE_LIBS) -Wl,--end-group -o $(TARGET)

I am not sure why this worked before.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文