在Cygwin上编译restclient cpp不会构建共享库

Compilation of restclient-cpp on Cygwin does not build shared libraries

本文关键字:构建 共享 cpp Cygwin 编译 restclient      更新时间:2023-10-16

我正试图在cygwin上使用restclient cpp;然而,当我尝试编译和安装库时,我得到以下消息:

    libtool: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared
libraries; building static only

事实上,我的程序一直编译到ld试图链接可执行文件的时候,一系列错误实际上都在说:

    undefined reference to `RestClient::post(std::string const&, std::string const&,
std::string const&)'
    relocation truncated to fit: R_X86_64_PC32 against undefined symbol `RestClient::post(
std::string const&, std::string const&, std::string const&)'
collect2: error: ld returned 1 exit status

对此有什么可能的解决方案吗?

我使用GCC 6.1.0、libtool 2.4.6 在cygwin上编译

编辑:已在上提交Github问题https://github.com/mrtazz/restclient-cpp/issues/55也许《图书馆》的作者会有答案的。

假设库中的所有符号都可用,您需要添加相关的Makefile.am将标志-no-undefined转换为正确的your_lib_la_LDFLAGS

关于-no-undefined ,请参阅libtool的手册