Skip to content

包含 socket.h 后,编译时报 undefined reference to `toft::Socket::Close() 错误 #126

Description

@lisnb

您好~
在使用toft的过程中,发现在包含了 toft/system/base/socket.h 这个头文件时,如果不依赖 toft/system/base:socket 的话,即使不使用这个头文件中定义的任何内容,比如:

#include "toft/system/base/socket.h"

int main() {
  return 0;
}

也会报

undefined reference to `toft::Socket::Close()'

这样的错误。
看起来和 toft::Socket 的析构函数是 inline 的,而且使用了在 cpp 中定义的 Socket::Close() 函数有关
请问您知道这是为什么么,这个是正常的么

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions