muquit / mailsend

A program to send mail via SMTP from command line
Other
294 stars 68 forks source link

Hello, has anyone compiled the latest version of the library for Mac Os ? #161

Open psapoznik opened 1 year ago

psapoznik commented 1 year ago

I try to compile it and I get the following error:

mutils_time.c:26:8: error: call to undeclared function 'gettimeofday'

muquit commented 1 year ago

At this time, please edit libs/libmutils/Makefile and add -DTIME_WITH_SYS_TIME=1 at the end of DEFS line. Then,

make clean
make

I will update the configure when get some time.

Thanks

psapoznik commented 1 year ago

Hello, thanks for replying, now I get this error:

main.c:964:21: error: call to undeclared function 'show_mime_types'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] show_mime_types(); ^ main.c:964:21: note: did you mean 'get_mime_type'? ./mailsend.h:332:14: note: 'get_mime_type' declared here char get_mime_type(char path); ^ 1 error generated. make: *** [main.o] Error 1

muquit commented 1 year ago

You are compiling without OpenSSL, the most SMTP servers require authentication, so the program will not be that useful if compiled without OpenSSL.

Anyway, this function was mistakenly inside HAVE_OPENSSL define. Edit mailsend.h and take the function show_mime_tyhpes() out of HAVE_OPENSSL block, like

#ifdef HAVE_OPENSSL
void        print_cert_info(SSL *ssl);
#endif /* HAVE_OPENSSL */
void        show_mime_types(void);

Thanks.

psapoznik commented 1 year ago

Hello , is that when I try to compile openSSL in static mode on Mac ,

./config --prefix=/path/ssl110istatic -static

I get the following error:

ld: library not found for -lcrt0.o clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [link_app.] Error 1 make[1]: [openssl] Error 2 make: *** [build_apps] Error 1

muquit commented 1 year ago

Please link with dynamic OpenSSL libs. Static linking in MacOS is not feasible. -static is used only for kernel in MacOS. man ld for details.

Thanks.