Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

库编译正常但使用时出现大量undefined reference to错误 #716

Open
rhino-li opened this issue Aug 22, 2024 · 2 comments
Open

Comments

@rhino-li
Copy link

环境

ubuntu 20.04
c++11
muduo 2.0.2
cmake 3.16.3
gcc 9.4.0
libboost-dev 1.17.0
protobuf 3.6.1

测试程序

examples中的echo示例

#include <iostream>
#include <functional>
#include <muduo/net/InetAddress.h>
#include <muduo/net/Buffer.h>
#include <muduo/net/TcpConnection.h>
#include <muduo/net/TcpServer.h>
#include <muduo/net/EventLoop.h>

using std::placeholders::_1;
using std::placeholders::_2;
using std::placeholders::_3;
// RFC 862
class EchoServer
{
    public:
    EchoServer(muduo::net::EventLoop* loop,
             const muduo::net::InetAddress& listenAddr)
             : server_(loop, listenAddr, "EchoServer")
             {
                server_.setConnectionCallback(
                    std::bind(&EchoServer::onConnection, this, _1));
                    server_.setMessageCallback(
                    std::bind(&EchoServer::onMessage, this, _1, _2, _3));
             };

    void start()
    {
        server_.start();
    }

 private:
    void onConnection(const muduo::net::TcpConnectionPtr& conn)
    {
  std::cout << "EchoServer - " << conn->peerAddress().toIpPort() << " -> "
           << conn->localAddress().toIpPort() << " is "
           << (conn->connected() ? "UP" : "DOWN");
    }

    void onMessage(const muduo::net::TcpConnectionPtr& conn,
                 muduo::net::Buffer* buf,
                 muduo::Timestamp time)
                {
                    muduo::string msg(buf->retrieveAllAsString());
                    std::cout << conn->name() << " echo " << msg.size() << " bytes, "
                        << "data received at " << time.toString();
                    conn->send(msg);
                }
    muduo::net::TcpServer server_;
};

int main()
{
  muduo::net::EventLoop loop;
  muduo::net::InetAddress listenAddr(2007);
  EchoServer server(&loop, listenAddr);
  server.start();
  loop.loop();
}

报错

g++ test.cpp -lmuduo_base -lmuduo_net -lpthread编译报错:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::handleRead()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:250: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:250: undefined reference to `muduo::LogStream::operator<<(long)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:250: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::~EventLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:95: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:95: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:95: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:95: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::~EventLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:96: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:95: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::abortNotInLoopThread()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:229: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:229: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:230: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::abortNotInLoopThread()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:231: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:229: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::wakeup()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:240: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:240: undefined reference to `muduo::LogStream::operator<<(long)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:240: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::printActiveChannels() const':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:275: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:275: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:275: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::EventLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:80: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:80: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:81: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:80: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::EventLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:38: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `createEventfd':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:38: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::loop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:109: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:116: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:132: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:109: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:109: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:109: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:132: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:132: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/EventLoop.cc:132: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::handleRead()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:250: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::abortNotInLoopThread()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:229: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::wakeup()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:240: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::printActiveChannels() const':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:275: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o): in function `muduo::net::EventLoop::EventLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoop.cc:77: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoop.cc.o):/home/lxr/installation/muduo/muduo/net/EventLoop.cc:80: more undefined references to `muduo::Logger::~Logger()' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::EPollPoller(muduo::net::EventLoop*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:46: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:46: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::update(int, muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:179: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:179: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:180: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:179: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:189: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:189: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:189: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:185: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:185: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::poll(int, std::vector<muduo::net::Channel*, std::allocator<muduo::net::Channel*> >*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:57: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:66: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:66: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:66: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:66: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:75: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:75: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:57: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:57: undefined reference to `muduo::LogStream::operator<<(unsigned long)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:57: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:83: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:83: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::updateChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:111: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:111: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:111: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:112: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:112: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:111: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::removeChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:155: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:155: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:155: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:155: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::update(int, muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:179: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:189: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:185: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o): in function `muduo::net::EPollPoller::poll(int, std::vector<muduo::net::Channel*, std::allocator<muduo::net::Channel*> >*)':
/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:66: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:57: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EPollPoller.cc.o):/home/lxr/installation/muduo/muduo/net/poller/EPollPoller.cc:111: more undefined references to `muduo::Logger::~Logger()' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::poll(int, std::vector<muduo::net::Channel*, std::allocator<muduo::net::Channel*> >*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:37: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:37: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:37: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:37: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:42: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:42: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:49: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:49: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::updateChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::removeChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:115: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:115: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:115: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:115: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::poll(int, std::vector<muduo::net::Channel*, std::allocator<muduo::net::Channel*> >*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:37: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::updateChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:78: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(PollPoller.cc.o): in function `muduo::net::PollPoller::removeChannel(muduo::net::Channel*)':
/home/lxr/installation/muduo/muduo/net/poller/PollPoller.cc:115: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::getLocalAddr(int)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:278: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:278: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::getPeerAddr(int)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:290: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:290: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::createNonblockingOrDie(unsigned short)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:91: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:91: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::bindOrDie(int, sockaddr const*)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:102: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:102: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::listenOrDie(int)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:111: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:111: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::accept(int, sockaddr_in6*)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:128: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:128: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:152: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:152: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:152: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:149: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:149: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::close(int)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:183: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:183: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::shutdownWrite(int)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:191: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:191: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::fromIpPort(char const*, unsigned short, sockaddr_in*)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:241: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:241: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::fromIpPort(char const*, unsigned short, sockaddr_in6*)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:252: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:252: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(SocketsOps.cc.o): in function `muduo::net::sockets::accept(int, sockaddr_in6*)':
/home/lxr/installation/muduo/muduo/net/SocketsOps.cc:152: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/SocketsOps.cc:149: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleError()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:426: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:427: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:427: undefined reference to `muduo::strerror_tl(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:426: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::defaultConnectionCallback(std::shared_ptr<muduo::net::TcpConnection> const&)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:25: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:25: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:25: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::~TcpConnection()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:68: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:68: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:68: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:69: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:68: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleWrite()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:403: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:403: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:403: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:403: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleWrite()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:394: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleClose()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:411: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:411: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:411: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:411: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleRead(muduo::Timestamp)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:363: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:363: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::sendInLoop(void const*, unsigned long)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:147: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:147: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::sendInLoop(void const*, unsigned long)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:167: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:167: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::TcpConnection(muduo::net::EventLoop*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, muduo::net::InetAddress const&, muduo::net::InetAddress const&)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:61: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:61: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:61: undefined reference to `muduo::LogStream::operator<<(void const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:62: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpConnection.cc:61: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::EventLoop* muduo::CheckNotNull<muduo::net::EventLoop>(muduo::Logger::SourceFile, int, char const*, muduo::net::EventLoop*)':
/home/lxr/installation/muduo/muduo/base/Logging.h:152: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/Logging.h:152: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleError()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:426: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::defaultConnectionCallback(std::shared_ptr<muduo::net::TcpConnection> const&)':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:25: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleWrite()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:403: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o): in function `muduo::net::TcpConnection::handleClose()':
/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:411: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpConnection.cc.o):/home/lxr/installation/muduo/muduo/net/TcpConnection.cc:61: more undefined references to `muduo::Logger::~Logger()' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::net::TcpServer::~TcpServer()':
/home/lxr/installation/muduo/muduo/net/TcpServer.cc:42: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:42: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:42: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::net::TcpServer::removeConnectionInLoop(std::shared_ptr<muduo::net::TcpConnection> const&)':
/home/lxr/installation/muduo/muduo/net/TcpServer.cc:109: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:109: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:109: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::net::TcpServer::newConnection(int, muduo::net::InetAddress const&)':
/home/lxr/installation/muduo/muduo/net/TcpServer.cc:80: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:80: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TcpServer.cc:80: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::net::TcpServer::newConnection(int, muduo::net::InetAddress const&)':
/home/lxr/installation/muduo/muduo/net/TcpServer.cc:80: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TcpServer.cc.o): in function `muduo::net::EventLoop* muduo::CheckNotNull<muduo::net::EventLoop>(muduo::Logger::SourceFile, int, char const*, muduo::net::EventLoop*)':
/home/lxr/installation/muduo/muduo/base/Logging.h:152: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/Logging.h:152: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TimerQueue.cc.o): in function `muduo::net::detail::resetTimerfd(int, muduo::Timestamp)':
/home/lxr/installation/muduo/muduo/net/TimerQueue.cc:79: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:79: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TimerQueue.cc.o): in function `muduo::net::detail::createTimerfd()':
/home/lxr/installation/muduo/muduo/net/TimerQueue.cc:36: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:36: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TimerQueue.cc.o): in function `muduo::net::detail::readTimerfd(int, muduo::Timestamp)':
/home/lxr/installation/muduo/muduo/net/TimerQueue.cc:61: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:64: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:64: undefined reference to `muduo::LogStream::operator<<(long)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:64: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:61: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:61: undefined reference to `muduo::LogStream::operator<<(unsigned long)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:61: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TimerQueue.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(TimerQueue.cc.o): in function `muduo::net::detail::readTimerfd(int, muduo::Timestamp)':
/home/lxr/installation/muduo/muduo/net/TimerQueue.cc:64: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/TimerQueue.cc:61: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Acceptor.cc.o): in function `muduo::net::Acceptor::handleRead()':
/home/lxr/installation/muduo/muduo/net/Acceptor.cc:76: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Acceptor.cc:76: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Acceptor.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Channel.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Channel.cc.o): in function `muduo::net::Channel::handleEventWithGuard(muduo::Timestamp)':
/home/lxr/installation/muduo/muduo/net/Channel.cc:86: undefined reference to `muduo::g_logLevel'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:98: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:98: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:98: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:86: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel, char const*)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:86: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:91: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, muduo::Logger::LogLevel)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:91: undefined reference to `muduo::LogStream::operator<<(int)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:91: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:98: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:86: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Channel.cc:91: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThreadPool.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::net::EventLoopThread::EventLoopThread(std::function<void (muduo::net::EventLoop*)> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/lxr/installation/muduo/muduo/net/EventLoopThread.cc:23: undefined reference to `muduo::Thread::Thread(std::function<void ()>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::net::EventLoopThread::~EventLoopThread()':
/home/lxr/installation/muduo/muduo/net/EventLoopThread.cc:35: undefined reference to `muduo::Thread::join()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::net::EventLoopThread::startLoop()':
/home/lxr/installation/muduo/muduo/net/EventLoopThread.cc:42: undefined reference to `muduo::Thread::start()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::net::EventLoopThread::~EventLoopThread()':
/home/lxr/installation/muduo/muduo/net/EventLoopThread.cc:27: undefined reference to `muduo::Thread::~Thread()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::net::EventLoopThread::EventLoopThread(std::function<void (muduo::net::EventLoop*)> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/lxr/installation/muduo/muduo/net/EventLoopThread.cc:23: undefined reference to `muduo::Thread::~Thread()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(EventLoopThread.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(InetAddress.cc.o): in function `muduo::net::InetAddress::resolve(muduo::StringArg, muduo::net::InetAddress*)':
/home/lxr/installation/muduo/muduo/net/InetAddress.cc:137: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/InetAddress.cc:137: undefined reference to `muduo::Logger::~Logger()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Poller.cc.o): in function `muduo::CurrentThread::tid()':
/home/lxr/installation/muduo/muduo/base/CurrentThread.h:24: undefined reference to `muduo::CurrentThread::t_cachedTid'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/base/CurrentThread.h:26: undefined reference to `muduo::CurrentThread::cacheTid()'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmuduo_net.a(Socket.cc.o): in function `muduo::net::Socket::setReusePort(bool)':
/home/lxr/installation/muduo/muduo/net/Socket.cc:111: undefined reference to `muduo::Logger::Logger(muduo::Logger::SourceFile, int, bool)'
/usr/bin/ld: /home/lxr/installation/muduo/muduo/net/Socket.cc:111: undefined reference to `muduo::Logger::~Logger()'
collect2: error: ld returned 1 exit status
@chenshuo
Copy link
Owner

改成 g++ test.cpp -lmuduo_net -lmuduo_base -lpthread 试试。

@ningliu2024
Copy link

ningliu2024 commented Oct 8, 2024

这种错误是初学者常见的问题了, 可以参考下 https://gitee.com/sacomplex/learnlibrary_notes/tree/master/muduo, 还有建议学下CMake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants