views:

284

answers:

3

Linking...
mongoose.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _push

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);
}
+1  A: 

It's not entirely clear what question you are actually asking. But it looks like your linker can't find the "send" function anywhere it's been told to look.

simon
+1  A: 

The difference from normal errors is that you need to use the linker, not the compiler and code editor, to solve it.

Christoffer
+3  A: 

The problem is that the linker can't find the send() function. You've included the proper header files, so the compiler is ok, but you're not linking with the proper static libraries. Open up your project settings, go to the Linker section, and add the proper library to the list of libraries that are linked in.

[Edit]

The correct library to add is wsock32.lib.

Adam Rosenfield
added wsock32.libhttp://www.codebase.com/support/kb/?article=C01060
Tommy