【发布时间】:2019-12-23 08:59:09
【问题描述】:
我尝试使用 g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39) 进行编译 一些使用我成功编译的uvlib的开源简单服务器 这是 github 存储库:
https://github.com/Matheus28/ws28
这是编译命令:
g++ echo.cpp -Wall -O0 -g -std=c++1y -I/home/vagrant/libuv/include -Isrc -L/home/vagrant/libuv/build -lssl -lcrypto -luv
但它给了我编译错误:
/tmp/cc21HhMd.o: In function `main::{lambda(ws28::Client*, char const*, unsigned long, int)#4}::operator()(ws28::Client*, char const*, unsigned long, int) const':
/home/vagrant/ws28/echo.cpp:36: undefined reference to `ws28::Client::Send(char const*, unsigned long, unsigned char)'
/tmp/cc21HhMd.o: In function `main::{lambda(uv_timer_s*)#6}::operator()(uv_timer_s*) const':
/home/vagrant/ws28/echo.cpp:58: undefined reference to `ws28::Server::StopListening()'
/tmp/cc21HhMd.o: In function `main':
/home/vagrant/ws28/echo.cpp:16: undefined reference to `ws28::Server::Server(uv_loop_s*, ssl_ctx_st*)'
/home/vagrant/ws28/echo.cpp:64: undefined reference to `ws28::Server::Listen(int, bool)'
/home/vagrant/ws28/echo.cpp:69: undefined reference to `ws28::Server::~Server()'
/home/vagrant/ws28/echo.cpp:69: undefined reference to `ws28::Server::~Server()'
collect2: error: ld returned 1 exit status
make: *** [out] Error 1
我不明白的是他从哪里来处理这个对象的线是什么?:
/tmp/cc21HhMd.o: In function `main::{lambda(ws28::Client*, char const*, unsigned long, int)#4}::operator()(ws28::Client*, char const*, unsigned long, int) const':
【问题讨论】:
标签: c++ linux compiler-errors g++ c++14