libssh argp_parse error (not declared in this scope) while porting libssh from arduino to esp-idf
i get the following error when compiling under esp-idf i have all argp files (.c ans .h) in the main project directory. thank for help !!
../main/SSH_TO_IDF.cpp: In function 'int ex_main(int, const char**, int)': ../main/SSH_TO_IDF.cpp:1199:5: error: 'argp_parse' was not declared in this scope argp_parse(&argp, argc, argv, 0, 0, sshbind); ^~~~~~~~~~ ../main/SSH_TO_IDF.cpp:1199:5: note: suggested alternative: 'argp_parser_t' argp_parse(&argp, argc, argv, 0, 0, sshbind); ^~~~~~~~~~ argp_parser_t
Update I try to comment out the argp.h define in config.h file to see if I will get other errors .... /* Define to 1 if you have the <argp.h> header file. */ //#define HAVE_ARGP_H 1
Now the error (logically) disapears but at link step i get a new error with sha1 definition
/ld: esp-idf/arduino/libarduino.a(kex.c.obj):(.literal.ssh_make_sessionid+0x30): undefined reference to sha1' /home/ammar/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/arduino/libarduino.a(kex.c.obj): in function ssh_make_sessionid':
/home/ammar/esp/SSH_TO_IDF/build/../components/arduino/libraries/LibSSH-ESP32/src/kex.c:1156: undefined reference to sha1' /home/ammar/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/arduino/libarduino.a(pki_mbedcrypto.c.obj): in function pki_sign_data':
/home/ammar/esp/SSH_TO_IDF/build/../components/arduino/libraries/LibSSH-ESP32/src/pki_mbedcrypto.c:1220: undefined reference to sha1' /home/ammar/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/arduino/libarduino.a(pki_mbedcrypto.c.obj): in function pki_verify_data_signature':
/home/ammar/esp/SSH_TO_IDF/build/../components/arduino/libraries/LibSSH-ESP32/src/pki_mbedcrypto.c:1302: undefined reference to `sha1'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
any suggestion is welcome. thank you
I have not tested the library as an Arduino component of IDF, just under the Arduino IDE and Arduino Builder. I would need to set up an environment before attempting to recreate the issue. I note above the first error is in the compiler and the second error in the linker. Unless I can recreate I am unable to be sure of the significance. If possible could you upload a test IDF project to GitHub with this library as a submodule.