我嘗試編譯這段代碼:爲什麼我得到:解析外部符號錯誤 - Visual C
static uint64_t
push(int fd, SOCKET sock, SSL *ssl, const char *buf, uint64_t len)
{
uint64_t sent;
int n, k;
sent = 0;
while (sent < len) {
/* How many bytes we send in this iteration */
k = len - sent > INT_MAX ? INT_MAX : (int) (len - sent);
if (ssl != NULL) {
n = SSL_write(ssl, buf + sent, k);
} else if (fd != -1) {
n = write(fd, buf + sent, k);
} else {
n = send(sock, buf + sent, k, 0);
}
if (n < 0)
break;
sent += n;
}
return (sent);
}
我得到這個連接錯誤: 鏈接...
mongoose.obj:錯誤LNK2019:無法解析外部符號_send @ 16在函數_push中引用
我在想什麼?它必須是一些lib或其他東西。我只是不記得我需要添加到我的鏈接。
added wsock32.lib http://www.codebase.com/support/kb/?article=C01060 – 2009-04-27 21:44:59