kokke / tiny-ECDH-c

Small portable Elliptic-Curve Diffie-Hellman in C
The Unlicense
254 stars 64 forks source link

compilation error #17

Closed sevgicorumlu closed 5 years ago

sevgicorumlu commented 5 years ago

/tmp/cc6EXGlG.o: In function ecdh_demo': ecdh_example.c:(.text+0x150): undefined reference toecdh_generate_keys' ecdh_example.c:(.text+0x1ad): undefined reference to ecdh_generate_keys' ecdh_example.c:(.text+0x1ea): undefined reference toecdh_shared_secret' ecdh_example.c:(.text+0x227): undefined reference to ecdh_shared_secret' /tmp/cc6EXGlG.o: In functionecdsa_broken': ecdh_example.c:(.text+0x337): undefined reference to ecdh_generate_keys' ecdh_example.c:(.text+0x358): undefined reference toecdsa_sign' ecdh_example.c:(.text+0x372): undefined reference to `ecdsa_verify' collect2: error: ld returned 1 exit status

kokke commented 5 years ago

Hi @sevgicorumlu and thanks for posting here :)

From the errors, it seems you are only compiling ecdh_example.c.

All the functions missing reside in ecdh.c. You need to also compile + link that file in the build.

This is a common error for less experienced developers. See similar issues in my AES project: https://github.com/kokke/tiny-AES-c/issues/107 https://github.com/kokke/tiny-AES-c/issues/79 https://github.com/kokke/tiny-AES-c/issues/71

Closing since this is a user-error, not including a file in the build.

sevgicorumlu commented 5 years ago

Hİ @kokke thank you.