A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By Caer
#61119
MickeN89 wrote:Having issues with the "user_callback_example" in http_get("http://wtfismyip.com/text","",http_callback user_callback);
getting undefined reference
any Ideas?
have cloned your project and made the changes you name and everything...


Make sure that you have this line right:

Code: Select allhttp_get("http://wtfismyip.com/text", "", http_callback_example);

Because you wrote http_callback user_callback instead of http_callback_example
User avatar
By Hd-extreeem
#61287 Hello good day!
I have a problem with the http_get method when i try to call the method it gives undefined reference, i have included the file and added the files to my project also? What am I doing wrong??? Also http_callback_example gives an undefined reference.
here is what prints out when running an all in eclipse for espresso:

build/app_app.a(user_main.o): In function `LEDBlinkTask':
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:35: undefined reference to `http_callback_example'
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:35: undefined reference to `http_get'
build/app_app.a(user_main.o): In function `camRotate':
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:40: undefined reference to `http_get'
collect2.exe: error: ld returned 1 exit status
../common_rtos.mk:230: recipe for target 'build/app.out' failed
mingw32-make.exe: *** [build/app.out] Error 1
User avatar
By Caer
#61406
Hd-extreeem wrote:build/app_app.a(user_main.o): In function `LEDBlinkTask':
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:35: undefined reference to `http_callback_example'
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:35: undefined reference to `http_get'
build/app_app.a(user_main.o): In function `camRotate':
C:\Espressif\examples\ESP8266\RTOS-ESP8266/user/user_main.c:40: undefined reference to `http_get'
collect2.exe: error: ld returned 1 exit status
../common_rtos.mk:230: recipe for target 'build/app.out' failed
mingw32-make.exe: *** [build/app.out] Error 1


The problem is not with your code, it is with the parameters you give to the compiler (gcc) in your Makefile.
Check that you have something like this in the "Makefile" file, and that "lib/esphttpclient" is in the correct location.
Code: Select allMODULES = driver user lib/esphttpclient


Or tell us more about your Makefile.
User avatar
By Hd-extreeem
#61414 This is what my makefile looks like right now, I have added the lib folder containing the esphttpclient files into my project.

# Main settings includes
include ../settings.mk

# Individual project settings (Optional)
SDK_BASE = c:/Espressif/ESP8266_RTOS_SDK
#BOOT = new
#APP = 1
SPI_SPEED = 80
#SPI_MODE = QIO
SPI_SIZE_MAP = 0
#ESPPORT = COM2
ESPBAUD = 74880

# Basic project settings
MODULES = driver user lib/esphtpclient
LIBS = gcc hal phy pp net80211 wpa crypto main freertos lwip minic smartconfig ssl

# Root includes
include ../common_rtos.mk

UPDATE: You might have seen what was wrong in the file, I had written in the MODULES = driver user lib/esphtpclient instead of esphttpclient. Anyway now i got it to compile the httpclient.c file but get a lot of errors that there is undefined reference for os_free, ets_strstr, os_malloc etc... In other words the include files in the httpclient seem not to find the include .h files for osapi.h, espconn.h, mem.h etc... Do you have any idea why? Have I missed something? Thanks in advance!