toft icon indicating copy to clipboard operation
toft copied to clipboard

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

Open lisnb opened this issue 7 years ago • 2 comments

您好~ 在使用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() 函数有关 请问您知道这是为什么么,这个是正常的么

lisnb avatar Sep 08 '17 12:09 lisnb

> g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)

> cat /etc/issue
CentOS release 6.5 (Final)

lisnb avatar Sep 11 '17 01:09 lisnb

可能是问题,我看看

2017-09-11 9:50 GMT+08:00 lisnb [email protected]:

g++ --version g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) cat /etc/issue CentOS release 6.5 (Final)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chen3feng/toft/issues/126#issuecomment-328395122, or mute the thread https://github.com/notifications/unsubscribe-auth/AB5-StKczuCwWB4f9qWACofFNS_fw-7Sks5shJHagaJpZM4PRIYu .

chen3feng avatar Sep 13 '17 02:09 chen3feng