0

I am trying to compile code that will perform an http POST using the GNU c++ compiler, and I get the following error:

http_post2.cpp:93: error: ‘strlen’ was not declared in this scope

The line that it points to is simply:

SEND_RQ("POST ");

I went up to see where SEND_RQ is defined and this is it:

#define SEND_RQ(MSG) \

                /*cout<<send_str;*/ \
    send(sock,MSG,strlen(MSG),0);

I have my includes above this, however and when I've added

#include <stdio.h>

and

#include <stdlib.h>

, it hasn't helped.

Edited by foco: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by foco
0

strlen is declared in <string.h>, or <cstring> if you want your stuff in the std namespace.

Edited by Narue: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.