GCC 4.5.0..编译期间链接错误?

发布于 2024-10-07 01:07:22 字数 1455 浏览 7 评论 0原文

嗯,我最近走出了黑暗时代,并使用 Cygwin 将我的 GCC 从 3.4.4 升级到 4.5.0(我在 Windows 上使用 Netbeans 6.8 以供将来参考) 。我尝试通过运行一个简单的程序来测试新的编译器。然而,运行失败,并指出 NetBeans“找不到 -lstdc++”。

有趣的。

我看进去...

C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.0

...其中 libstdc++.alibstdc++.dll.alibstdc++ .lalibsupc++.alibsupc++.la 应该是(它们位于 3.4.4 文件夹中的那个位置),并且它们不在那儿。我还注意到其他事情:有一个 4.3.4 文件夹......

C:\cygwin\lib\gcc\i686-pc-cygwin

其中包含这些确切的文件!好的。所以我将它们复制到 4.5.0 文件夹中并尝试再次运行该程序。这次我遇到了另外两个错误:

build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1435:对“std”的未定义引用: :_List_node_base::_M_hook(std::_List_node_base*)'

和:

build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1451:对“std”的未定义引用: :_List_node_base::_M_unhook()'

此时我发现我已经无法理解,决定在复制和粘贴更多文件之前寻求帮助。如果有人能告诉我如何让它工作,我将非常感激。

(如果任何解决方案涉及命令行,请注意我不太熟悉它......您可能需要向其他 SO 用户提供不需要的额外详细信息!)

编辑:< /strong> PATH 变量如下:

C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\CVSNT\;C:\cygwin\bin

是的,安装的 Cygwin 是该站点的最新版本。

Well I've recently come out of the dark ages and upgraded my GCC from 3.4.4 to 4.5.0 with Cygwin (I use Netbeans 6.8 on Windows for future reference). I tried testing the new compiler by attempting to run a simple program through it. The run failed however, citing that NetBeans "cannot find -lstdc++".

Interesting.

I look in ...

C:\cygwin\lib\gcc\i686-pc-cygwin\4.5.0

...where libstdc++.a, libstdc++.dll.a, libstdc++.la, libsupc++.a, and libsupc++.la are supposed to be (they're in that spot in the 3.4.4 folder), and they're not there. I also notice something else: there's a 4.3.4 folder in...

C:\cygwin\lib\gcc\i686-pc-cygwin

which contains these exact files! Good. So I copy them in to the 4.5.0 folder and try to run the program again. This time i'm getting two other errors:

build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1435: undefined reference to `std::_List_node_base::_M_hook(std::_List_node_base*)'

and:

build/Debug/Cygwin-Windows/extract_fail_operations.o:/usr/lib/gcc/i686-pc-cygwin/4.5.0/include/c++/bits/stl_list.h:1451: undefined reference to `std::_List_node_base::_M_unhook()'

At this point I figured that I was way over my head and decided to come for help before copying and pasting any more files. If anyone could tell me how to get this working, i'd be really appreciative.

(If any solutions involve the command line, please be warned that i'm not well versed in it... you may have to provide extra details that you wouldn't need to to other SO users!)

EDIT: The PATH variables are as follows:

C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\CVSNT\;C:\cygwin\bin

And yes, the Cygwin installed is the latest from the site.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

还给你自由 2024-10-14 01:07:22

您需要安装 libstdc++6-devel 4.5.0 版本。

You need to install version 4.5.0 of libstdc++6-devel.

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