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

libssh argp_parse error (not declared in this scope) while porting libssh from arduino to esp-idf #8

Open
youssefIOT opened this issue Jun 2, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@youssefIOT
Copy link

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

@youssefIOT
Copy link
Author

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

@ewpa
Copy link
Owner

ewpa commented Jun 2, 2021

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.

@ewpa
Copy link
Owner

ewpa commented Sep 28, 2024

Fixed with commit 057ada8. Please check and confirm.

@ewpa ewpa self-assigned this Sep 28, 2024
@ewpa ewpa added the enhancement New feature or request label Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants