【问题标题】:Error in ./configure step in installation of libpqxx安装 libpqxx 的 ./configure 步骤出错
【发布时间】:2018-10-02 22:34:05
【问题描述】:

这有点远,但是: 我正在关注本指南:https://www.tutorialspoint.com/postgresql/postgresql_c_cpp.htm

但是在运行 ./configure 时出现以下错误:

(previous checking lines omitted for brevity)
checking for main in -lpq... yes
checking for PQexec in -lpq... yes
checking for correct C++ linkage of basic libpq functions... 

sed: character class syntax is [[:space:]], not [:space:]
configure: error:
Linking a call to libpq failed in C++, even though it succeeded in C.  If your
C and C++ compilers are very different beasts, this may mean that we do not have
the right options for linking with it after all.

Read the config.log file for more detailed information.  Look for the last error
message, which may be several pages up from the end of the file.

configure.log 文件如下所示:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by libpqxx configure 4.0, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##
(some lines omitted)
configure:3039: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3050: $? = 1
configure:3039: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
(some lines omitted)
configure:7629: gcc -E  conftest.c
conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory
 #include <ac_nonexistent.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
(some lines omitted)
configure:8319: gcc -c -g -O2  -fno-rtti -fno-exceptions conftest.c >&5
cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C
(some lines omitted)
configure:16424: g++ -o conftest -g -O2   -L/usr/lib/x86_64-linux-gnu conftest.cpp  >&5
/tmp/ccfFBf4K.o: In function `main':
/home/peter/libpqxx-4.0/conftest.cpp:44: undefined reference to `PQexec'
collect2: error: ld returned 1 exit status
(some liens omitted)

我相信我没有丢失任何包裹。我安装了最新版本的 g++、psql 和 libpqxx。

我已经更新和升级了我系统上的所有软件包。

我已经在网上搜索了这个错误的解决方案,但我不知道出了什么问题。

你知道我可以从这里去哪里吗?

【问题讨论】:

    标签: postgresql ubuntu g++ configure libpqxx


    【解决方案1】:

    很久没有在老地方发布libpqxx 的tarball 版本了,所以您使用wget 命令下载tarball 的教程已经过时了。

    您遇到的问题看起来与this issue 相关,并且似乎已在this commit 中修复:

    commit 85e9336740475be25ed19924cca0961f7d844c4b
    Author: Jeroen Vermeulen <jtvjtv@gmail.com>
    Date:   Thu Jun 1 11:39:08 2017 +0700
    
        Fix #13: not linking to libpq.
    
        This was that annoying interaction between autoconf, m4, GNU sed syntax,
        and the shell which broke the "remove redundant -lpq options" code in
        the configure script.
    
        Solution: forget about GNU sed's "[[:space:]]" syntax, and just look for
        a literal space.  There aren't going to be any tabs, newlines,
        non-breaking spaces, etc. there in even a moderately sane world.
    

    【讨论】:

    • 谢谢,我已经把错误信息贴在issue you provided,希望他们能回答。我也为你的回应投了赞成票。如果我找到让它工作的方法,我会在下面发布答案。最好的,彼得。
    • 你是从 Github 结账开始的吗?你说你在关注this,但是那个教程已经过时了(用于下载压缩包的wget自2011年左右以来一直没有改变)。
    • “Github checkout”是什么意思,我应该尝试从 Github 下载最新的实现吗?另外,是的,也许教程很旧,但我能做些什么不同的事情?
    • 是的,尝试从 Github 结帐开始。我确定错误会在那里消失。
    • 对!为什么我没有想到。他们有指南和一切:github.com/jtv/libpqxx 谢谢!我会告诉你它是否有效:)
    猜你喜欢
    • 2016-02-16
    • 2012-10-31
    • 2011-05-04
    • 1970-01-01
    • 2018-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-13
    相关资源
    最近更新 更多