【问题标题】:checking whether g++ can link programs检查 g++ 是否可以链接程序
【发布时间】:2017-02-20 15:23:17
【问题描述】:

我在尝试构建 glibc 时在日志中收到以下错误:

configure:3180: checking whether g++ can link programs
configure:3203: g++ -o conftest -g -O2   conftest.cpp  >&5
configure:3203: $? = 0
configure:3226: g++ -o conftest -g -O2   -static conftest.cpp  >&5
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: cannot find -lm
/usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
configure:3226: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| #define PACKAGE_URL "http://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<http://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h.  */
|
| #include <iostream>
|
| int
| main()
| {
|   std::cout << "Hello, world!";
|   return 0;
| }
|
configure:3241: result: no
configure:3248: error: you must configure in a separate build directory

有什么解决办法吗?

如何重现它:

here下载glibc并尝试制作./configure

【问题讨论】:

    标签: c++ g++ glibc


    【解决方案1】:

    我认为错误本身是否是一个很好的提示?它说你应该在构建目录中配置,所以在顶部源目录中创建一个名为 build 的目录并 cd 到它然后运行 ​​../configure.

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-21
    • 2016-12-13
    • 1970-01-01
    • 2011-06-14
    • 2016-05-01
    • 1970-01-01
    • 2020-03-16
    相关资源
    最近更新 更多