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

Error: implicit declaration of function #10

Closed
tinamore opened this issue Aug 21, 2015 · 3 comments
Closed

Error: implicit declaration of function #10

tinamore opened this issue Aug 21, 2015 · 3 comments

Comments

@tinamore
Copy link

Hi
Thankyou for your project

I combine esphttpclient into epshttpd. When compile show error:

CC httpclient.c
httpclient.c: In function 'esp_strdup':
httpclient.c:45:2: error: implicit declaration of function 'pvPortMalloc' [-Werror=implicit-function-declaration]
char * new_str = (char *)os_malloc(os_strlen(str) + 1); // 1 for null character
^
httpclient.c:45:2: error: implicit declaration of function 'ets_strlen' [-Werror=implicit-function-declaration]
httpclient.c:47:3: error: implicit declaration of function 'os_printf_plus' [-Werror=implicit-function-declaration]
os_printf("esp_strdup: malloc error");
^
httpclient.c:50:2: error: implicit declaration of function 'ets_strcpy' [-Werror=implicit-function-declaration]
os_strcpy(new_str, str);
^
httpclient.c: In function 'receive_callback':
httpclient.c:76:2: error: implicit declaration of function 'ets_memcpy' [-Werror=implicit-function-declaration]
os_memcpy(new_buffer, req->buffer, req->buffer_size);
^
httpclient.c:80:2: error: implicit declaration of function 'vPortFree' [-Werror=implicit-function-declaration]
os_free(req->buffer);
^
httpclient.c: In function 'connect_callback':
httpclient.c:119:3: error: implicit declaration of function 'ets_sprintf' [-Werror=implicit-function-declaration]
os_sprintf(post_headers, "Content-Length: %d\r\n", strlen(req->post_data));
^
httpclient.c: In function 'disconnect_callback':
httpclient.c:166:4: error: implicit declaration of function 'ets_strncmp' [-Werror=implicit-function-declaration]
if (os_strncmp(req->buffer, version, strlen(version)) != 0) {
^
httpclient.c:170:5: error: implicit declaration of function 'atoi' [-Werror=implicit-function-declaration]
http_status = atoi(req->buffer + strlen(version));
^
httpclient.c:171:5: error: implicit declaration of function 'ets_strstr' [-Werror=implicit-function-declaration]
body = (char *)os_strstr(req->buffer, "\r\n\r\n") + 4;

^

Can you fix help me. Thanks

@vowstar
Copy link
Contributor

vowstar commented Nov 19, 2015

I think there is something wrong with your SDK, please reconfigure it.

@by2coffee
Copy link

Download espmissingincludes.h to your include folder and #include it user_main.c (or another appropriate place)

I think the errors you are getting is because many of the SDK functions don't have a declaration (Espressif "forgot" to provide them) and because you are compiling with -Werror
(all warnings are treated as errors)

@Caerbannog
Copy link
Owner

@by2coffee was right
This should now be fixed in master.

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

4 participants