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

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

Open
lisnb opened this issue Sep 8, 2017 · 2 comments

Comments

@lisnb
Copy link

lisnb commented Sep 8, 2017

您好~
在使用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
Copy link
Author

lisnb commented Sep 11, 2017

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

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

@chen3feng
Copy link
Owner

chen3feng commented Sep 13, 2017 via email

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

2 participants