twekkel / htpdate

HTTP Time protocol
https://www.vervest.org/htp
Other
50 stars 13 forks source link

htpdate.c:(.text+0x4e6): undefined reference to `TLS_method' #16

Closed Polynomial-C closed 2 years ago

Polynomial-C commented 2 years ago

Hi,

while trying to switch upstream for htpdate in Gentoo, I stumbled upon the following compile issue:

x86_64-pc-linux-gnu-gcc -Wall -march=native -mtune=native -O2 -pipe -DENABLE_HTTPS -o htpdate htpdate.c
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-misc/htpdate-9999/temp/ccjeTQYF.o: in function `getHTTPdate':
htpdate.c:(.text+0x4e6): undefined reference to `TLS_method'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x4ee): undefined reference to `SSL_CTX_new'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x4fe): undefined reference to `SSL_CTX_set_default_verify_paths'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x50b): undefined reference to `SSL_CTX_set_verify_depth'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x525): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x657): undefined reference to `SSL_set_fd'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x707): undefined reference to `SSL_write'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x721): undefined reference to `SSL_read'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa1a): undefined reference to `SSL_shutdown'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa24): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa2c): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xbfd): undefined reference to `SSL_CTX_set_verify'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xcc4): undefined reference to `SSL_connect'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-misc/htpdate-9999/temp/ccjeTQYF.o: in function `main':
htpdate.c:(.text.startup+0x4ca): undefined reference to `OPENSSL_init_ssl'
collect2: error: ld returned 1 exit status
make: *** [Makefile:14: htpdate] Error 1

This is an an up-to-date Gentoo machine having openssl-1.1.1m installed. Any chance this can be fixed?

twekkel commented 2 years ago

Hi Lars,

You are not using the Makefile, make https?

try adding -lssl

like this

gcc -Wall -march=native -mtune=native -O2 -pipe -DENABLE_HTTPS -o htpdate htpdate.c -lssl

Regards, Eddy

On 2022-01-23 20:32, Lars Wendler wrote:

Hi,

while trying to switch upstream for htpdate in Gentoo, I stumbled upon the following compile issue:

x86_64-pc-linux-gnu-gcc -Wall -march=native -mtune=native -O2 -pipe -DENABLE_HTTPS -o htpdate htpdate.c /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-misc/htpdate-9999/temp/ccjeTQYF.o: in function getHTTPdate': htpdate.c:(.text+0x4e6): undefined reference toTLS_method' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x4ee): undefined reference to SSL_CTX_new' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x4fe): undefined reference to SSL_CTX_set_default_verify_paths' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x50b): undefined reference to SSL_CTX_set_verify_depth' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x525): undefined reference toSSL_new' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x657): undefined reference to SSL_set_fd' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x707): undefined reference toSSL_write' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0x721): undefined reference to SSL_read' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa1a): undefined reference toSSL_shutdown' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa24): undefined reference to SSL_CTX_free' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xa2c): undefined reference toSSL_free' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xbfd): undefined reference to SSL_CTX_set_verify' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: htpdate.c:(.text+0xcc4): undefined reference toSSL_connect' /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/net-misc/htpdate-9999/temp/ccjeTQYF.o: in function main': htpdate.c:(.text.startup+0x4ca): undefined reference to OPENSSL_init_ssl' collect2: error: ld returned 1 exit status make: *** [Makefile:14: htpdate] Error 1

This is an an up-to-date Gentoo machine having openssl-1.1.1m installed. Any chance this can be fixed?

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. Triage notifications on the go with GitHub Mobile for iOS [3] or Android [4]. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Links:

[1] https://github.com/twekkel/htpdate/issues/16 [2] https://github.com/notifications/unsubscribe-auth/ANVLPJS2RIMKFZOHGDFIC3TUXRJWHANCNFSM5MTXCVJQ [3] https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 [4] https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

twekkel commented 2 years ago

can this issue be closed?

Polynomial-C commented 2 years ago

Yes. I've read the Makefile more thoroughly and finally found my error.