zanllp / sion

A single-header, cross-platform C++ library for making asynchronous HTTP(s) Requests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

g++ 7.5.0版本编译报错

Shaw666 opened this issue · comments

Thread model: posix
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)

报错错误如下:
/tmp/ccaD5zPb.s: Assembler messages:
/tmp/ccaD5zPb.s:7824: Error: symbol `_ZNK4sionUlvE_clEv' is already defined
...

demo代码如下:
`
#include
#define SION_DISABLE_SSL
#include "sion/sion.h"

static int req_id = 0;
static sion::Async async_thread_pool;

int main() {
std::string url;
std::string body;
int timeoutMs;
std::string content_type;
int req;

async_thread_pool.Run(
    [body, url, content_type] {
        return sion::Request()
            .SetUrl(url)
            .SetHttpMethod(sion::Method::Post)
            .SetBody(body)
            .SetHeader("Content-Type", content_type);
    },
    [req](sion::AsyncResponse async_resp) {
        // qDebug() << req << async_resp.err_msg.c_str();
    });
return 0;

}

补充下编译命令:
g++ -o out -std=c++11 test_sion.cpp -I/home/xhp/work/publibs/include -I/home/xhp/work/publibs/64/OpenSSL/include -L/home/xhp/work/publibs/64/OpenSSL/lib -llibcrypto -llibssl