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 "SIZEOF_CURL_OFF_T not defined" #1827

Closed
Renata27 opened this issue Aug 24, 2017 · 12 comments
Closed

error "SIZEOF_CURL_OFF_T not defined" #1827

Renata27 opened this issue Aug 24, 2017 · 12 comments
Labels

Comments

@Renata27
Copy link

Renata27 commented Aug 24, 2017

Please help me find out whats is going on...
After downloading the latest version, the code doesn't compile anymore! I never saw these errors before!
I depende on this for my project to work.

 C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c:101:4: error: #error "SIZEOF_CURL_OFF_T not defined"
 #  error "SIZEOF_CURL_OFF_T not defined"
    ^
C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c: In function 'curlx_uztoso':
C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c:192:40: error: 'CURL_MASK_SCOFFT' undeclared (first use in this function)
   return (curl_off_t)(uznum & (size_t) CURL_MASK_SCOFFT);
                                        ^
C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c:192:40: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c:197:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1.exe: some warnings being treated as errors
make[1]: *** [/c/Users/Renata/Desktop/esp-idf-v2.1/make/component_wrapper.mk:211: lib/warnless.o] Error 1
make: *** [C:/Users/Renata/Desktop/esp-idf-v2.1/make/project.mk:386: curl-build] Error 2
xtensa-esp32-elf-gcc -std=gnu99 -Og -ggdb -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -DWITH_POSIX -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DHAVE_CONFIG_H -DBUILDING_LIBCURL -DESP_PLATFORM -D IDF_VER=\"v2.1\" -MMD -MP   -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/app_update/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/bootloader_support/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/bt/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/coap/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/coap/port/include/coap -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/coap/libcoap/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/coap/libcoap/include/coap -I /c/Users/Renata/Desktop/esp-idf-v2.1/components/cxx/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/driver/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/esp32/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/ethernet/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/expat/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/expat/include/expat -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/fatfs/src -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/freertos/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/jsmn/include/ -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/json/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/json/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/libsodium/libsodium/src/libsodium/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/libsodium/port_include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/log/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/lwip/include/lwip -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/lwip/include/lwip/port -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/lwip/include/lwip/posix -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/lwip/apps/ping -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/mbedtls/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/mbedtls/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/mdns/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/micro-ecc/micro-ecc -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/newlib/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/newlib/platform_include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/nghttp/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/nghttp/nghttp2/lib/includes -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/nvs_flash/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/openssl/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/sdmmc/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/soc/esp32/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/spi_flash/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/tcpip_adapter/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/ulp/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/vfs/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/wear_levelling/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/wpa_supplicant/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/wpa_supplicant/port/include -I C:/Users/Renata/Desktop/esp-idf-v2.1/components/xtensa-debug-module/include -I /c/Users/Renata/Desktop/esp-idf-template/main/include -I C:/Users/Renata/Desktop/esp-idf-template/build/include  -Ilib -c C:/Users/Renata/Desktop/esp-idf-v2.1/components/curl/lib/warnless.c -o lib/warnless.o
make[1]: Leaving directory 'C:/Users/Renata/Desktop/esp-idf-template/build/curl'      

I did this

Using the configuration files from Kolban for ESP IDF v2.1 for ESP32, I can't compile anymore.

screenshot 2017-08-24 20 38 54

curl/libcurl version

the latest

Windows 10

@bagder bagder added the build label Aug 24, 2017
@bagder
Copy link
Member

bagder commented Aug 24, 2017

Using the configuration files from Kolban for ESP IDF v2.1 for ESP32, I can't compile anymore.

I'm sorry, but can you clarify what this means? What configuration files and how do they get used to build curl? Those are not files provided by the curl project...

the latest

Do you mean that you downloaded a 7.55.1 tarball and built from that source code or that you built from the current git?

@Renata27
Copy link
Author

Renata27 commented Aug 25, 2017

HI, thanks for answering!

These files have already worked for me with previously curl versions:
https://github.com/nkolban/esp32-snippets/tree/master/curl/build_files

I build directly from:
$ git clone https://github.com/curl/curl.git

Aprecciate your help! Don't know what else to do.

How could I build in Windows for using with ESP IDF - ESP32:
https://github.com/espressif/esp-idf/releases
https://github.com/espressif/esp-idf-template
I have already set the environmet msys32 and worked until see this new instruction from Kolban's Book:

To build libcurl we create a components directory and perform some commands within.
The curl source can be downloaded from github using:
$ git clone https://github.com/curl/curl.git
Next we run:
$ ./buildconf
$ ./configure
Remove the following from lib/curl_config.h
HAVE_LIBSSL
USE_OPENSSL
HAVE_ZLIB
HAVE_LIBZ
HAVE_SIGSETJMP
HAVE_SYS_POLL
HAVE_POLL
HAVE_POLL_H
HAVE_CLOCK_GETTIME_MONOTONIC
HAVE_NET_IF_H
HAVE_SYS_IOCTL_H
HAVE_SYS_SELECT_H
HAVE_SYS_UN_H
HAVE_NETINET_TCP_H
HAVE_MSG_NOSIGNAL
HAVE_POLL_FINE
USE_UNIX_SOCKETS
HAVE_IFADDRS_H
HAVE_STROPTS_H
HAVE_GETIFADDRS
HAVE_IOCTL_SIOCGIFADDR
HAVE_GETHOSTNAME
HAVE_GETEUID
HAVE_BASENAME
HAVE_SIGNAL
When building curl, we may need to set some definitions:
The following can be found include/curl/curlbuild.h:
• CURL_SIZEOF_LONG – 4 – The size in bytes of a long.
• CURL_TYPEOF_CURL_SOCKLEN_T – unsigned int – The data type that is a
socklen_t.
• CURL_TYPEOF_CURL_OFF_T – long
• CURL_FORMAT_CURL_OFF_T – "ld"
• CURL_FORMAT_CURL_OFF_TU – "lu"
• CURL_FORMAT_OFF_T – "%ld"
• CURL_SIZEOF_CURL_OFF_T – 4
• CURL_SUFFIX_CURL_OFF_T – L
• CURL_SUFFIX_CURL_OFF_TU – UL
We also need a lib/curl_config.h
We will also need a component.mk with the following entries:
COMPONENT_SRCDIRS:=lib
COMPONENT_PRIV_INCLUDEDIR:=lib include
include $(IDF_PATH)/make/component_common.mk
We need to say that we don't have includes:
• netinet/in.h – HAVE_NETINET_IN_H
• arpa/inet.h – HAVE_ARPA_INET_H
• net/if.h – HAVE_NET_IF_H
• sys/ioctl.h – HAVE_SYS_IOCTL_H
• process.h – HAVE_PROCESS_H
• fcntl.h – HAVE_FCNTL_H
• netinet/tcp.h – HAVE_NETINET_TCP_H

But I think this is going to work only for Linux., am I right?

@bagder
Copy link
Member

bagder commented Aug 25, 2017

How could I build in Windows for using with ESP IDF - ESP32

I have no idea. You need to ask the team behind "ESP IDF - ESP32" for that. It's not something we provide in this project and I don't know what it is or how it works.

The following can be found include/curl/curlbuild.h

That file should be removed. It's not used/shipped anymore. If you have that, it's a leftover from an old build.

When you've run configure, you'll find #define SIZEOF_CURL_OFF_T ... in lib/curl_config.h. Don't you?

@Renata27
Copy link
Author

Now I am doing what GIT-INFO says:

To build in environments that support configure, after having extracted
everything from git, do this:

./buildconf
./configure
make

Daniel uses a ./configure line similar to this for easier development:

./configure --disable-shared --enable-debug --enable-maintainer-mode

In environments that don't support configure (i.e. Microsoft), do this:

buildconf.bat

REQUIREMENTS

For buildconf (not buildconf.bat) to work, you need the following software
installed:

o autoconf 2.57 (or later)
o automake 1.7 (or later)
o libtool 1.4.2 (or later)
o GNU m4 (required by autoconf)

I need this now, right?

@bagder
Copy link
Member

bagder commented Aug 25, 2017

I need this now, right?

What this are you referring to?

Your comment above already says you did buildconf + configure so that's all good. If you invoke 'make' after that you'll build it. But you seem to do something special after the configure step that isn't just make...

@Renata27
Copy link
Author

No, I never did buildconf+configure before to get things working!

But when I downloaded the latest libcurl, I see errors, as the curl_config.h won't work anymore...

I am using eclipse... I just need to get curl working on my C code...

I am now installing:
o autoconf 2.57 (or later)
o automake 1.7 (or later)
o libtool 1.4.2 (or later)
o GNU m4 (required by autoconf)

After that I am going to try buildconf+configure.

Thank you!

@Renata27
Copy link
Author

Hi badger,

after installing everything I could build curl.

Now I find error related to curl_setup.h and threads.

Could you please help me?

image

@Renata27
Copy link
Author

Renata27 commented Aug 25, 2017

Recovering previous environment, these errors are solved.
But know I have this:
Description Resource Path Location Type
Symbol 'CURLE_OK' could not be resolved power_save.c /esp32pro2/main line 1539 Semantic Error

image

Thanks!

@bagder
Copy link
Member

bagder commented Aug 25, 2017

CURLE_OK is an enum provided by the public curl/curl.h header.

@bagder
Copy link
Member

bagder commented Aug 25, 2017

Hi!

Thanks for your interest in curl and related manners, but you seem to have asked a question or help, and this is an issue tracker that we reserve for dealing with issues/bugs really.

Please ask questions and ask for support etc on the dedicated mailing lists. You will also reach a lot more people that way!

@bagder bagder closed this as completed Aug 25, 2017
@remoe
Copy link
Contributor

remoe commented Oct 26, 2017

Hi

I have this compile error also on Windows with libCurl 7.56.1 with CMake. The same configuration works with 7.55.1

@bagder
Copy link
Member

bagder commented Oct 26, 2017

Adding a comment to an old and closed issue won't help you. But we do build curl for windows with cmake for every commit and pull-request and that seems to work...

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants