ESP32_curl_example
ESP32_curl_example copied to clipboard
'i686-w64-mingw32-gcc' and error in 'access'
Hello,
I was trying to build these and got some errors. I'm using mingw32 on Windows 10 and have the xtensa-esp32-elf toolchain on Linux. I can build the sample applications from https://github.com/espressif/esp-idf
On Windows, this is the error I get: i686-w64-mingw32-gcc -fno-strict-aliasing -march=i686 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -DNDEBUG -I/usr/include/ffi -I/usr/include/libffi -IC:/msys32/mingw32/include/python2.7 -c c/_cffi_backend.c -o build/temp.mingw-2.7/c/_cffi_backend.o error: command 'i686-w64-mingw32-gcc' failed: No such file or directory
----------------------------------------
Command "C:/msys32/mingw32/bin/python.exe -u -c "import setuptools, tokenize;file='c:/users/user/appdata/local/temp/pip-install-kc6z4w/cffi/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:/users/user/appdata/local/temp/pip-record-rniai1/install-record.txt --single-version-externally-managed --prefix c:/users/user/appdata/local/temp/pip-build-env-6mroua/overlay --compile" failed with error code 1 in c:/users/user/appdata/local/temp/pip-install-kc6z4w/cffi/
Command "C:/msys32/mingw32/bin/python.exe C:/msys32/mingw32/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix c:/users/user/appdata/local/temp/pip-build-env-6mroua/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools>=18.5 wheel "cffi>=1.8,!=1.11.3; python_implementation != 'PyPy'"" failed with error code 1 in None
It seems to be the same error someone else got recently, not sure if this helps, http://bbs.esp32.com/viewtopic.php?f=13&t=9304
In Linux, the error I get is
user@Wren-Dev-Env:~/esp/ESP32_curl_example$ make all && make flash
LD build/testCurl.elf
/home/user/esp/ESP32_curl_example/build/curl/libcurl.a(ssh.o): In function access': /home/user/esp/ESP32_curl_example/components/curl/lib/ssh.c:403: multiple definition of access'
/home/user/esp/ESP32_curl_example/build/vfs/libvfs.a(vfs.o):/home/user/esp/esp-idf/components/vfs/vfs.c:707: first defined here
collect2: error: ld returned 1 exit status
make: *** [/home/user/esp/esp-idf/make/project.mk:407: /home/user/esp/ESP32_curl_example/build/testCurl.elf] Error 1
Am I missing a package or a setting somewhere? I was able to run "make menuconfig" and set up the project for email and wifi. Any help would be appreciated! Thank you!
Have you fixed this problem in Linux now? I got this error too.
i have same problem , need help
Edit ESP32_curl_example/components/curl/lib/ssh.c and comment out access().
#if 0
int access (const char *file, int type)
{
struct stat stbuf;
gid_t gid;
uid_t uid;
if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0) {
errno = EINVAL;
return -1;
}
if(stat(file, &stbuf) == -1)
return -1;
// No getgid() and getuid()? Well, we are God!
// gid = getgid();
// uid = getuid();
uid = stbuf.st_uid;
gid = stbuf.st_gid;
if(uid == stbuf.st_uid) {
if( ((type & R_OK) && !(stbuf.st_mode & S_IRUSR) ) ||
((type & W_OK) && !(stbuf.st_mode & S_IWUSR) ) ||
((type & X_OK) && !(stbuf.st_mode & S_IXUSR) ) ) {
errno = EACCES;
return -1;
}
}
else if(gid == stbuf.st_gid) {
if( ((type & R_OK) && !(stbuf.st_mode & S_IRGRP) ) ||
((type & W_OK) && !(stbuf.st_mode & S_IWGRP) ) ||
((type & X_OK) && !(stbuf.st_mode & S_IXGRP) ) ) {
errno = EACCES;
return -1;
}
}
else {
if( ((type & R_OK) && !(stbuf.st_mode & S_IROTH) ) ||
((type & W_OK) && !(stbuf.st_mode & S_IWOTH) ) ||
((type & X_OK) && !(stbuf.st_mode & S_IXOTH) ) ) {
errno = EACCES;
return -1;
}
}
return 0;
}
#endif
You can use this.
Edit ESP32_curl_example/components/curl/lib/ssh.c and comment out access().
#if 0 int access (const char *file, int type) { struct stat stbuf; gid_t gid; uid_t uid; if (file == NULL || (type & ~(R_OK|W_OK|X_OK|F_OK)) != 0) { errno = EINVAL; return -1; } if(stat(file, &stbuf) == -1) return -1; // No getgid() and getuid()? Well, we are God! // gid = getgid(); // uid = getuid(); uid = stbuf.st_uid; gid = stbuf.st_gid; if(uid == stbuf.st_uid) { if( ((type & R_OK) && !(stbuf.st_mode & S_IRUSR) ) || ((type & W_OK) && !(stbuf.st_mode & S_IWUSR) ) || ((type & X_OK) && !(stbuf.st_mode & S_IXUSR) ) ) { errno = EACCES; return -1; } } else if(gid == stbuf.st_gid) { if( ((type & R_OK) && !(stbuf.st_mode & S_IRGRP) ) || ((type & W_OK) && !(stbuf.st_mode & S_IWGRP) ) || ((type & X_OK) && !(stbuf.st_mode & S_IXGRP) ) ) { errno = EACCES; return -1; } } else { if( ((type & R_OK) && !(stbuf.st_mode & S_IROTH) ) || ((type & W_OK) && !(stbuf.st_mode & S_IWOTH) ) || ((type & X_OK) && !(stbuf.st_mode & S_IXOTH) ) ) { errno = EACCES; return -1; } } return 0; } #endifYou can use this.
this solved the current issue