c – How to use OpenSSL in GCC?

I am trying to use openssl in a gcc program, but it does not work properly.

g++ server.cpp /usr /lib/libssl.a -o server

gives an error message, just like the -l option. What must I type on the command line to link with openssl? The file /usr/lib/libssl.a exists, but I still get the linker error No such function MD5() exists.

< div class="answer"> Without knowing the exact error you are seeing, it is difficult to provide an accurate solution. This is my best attempt.

According to what you provide It sounds like the linker failed because it can’t find a reference to the md5 function in libssl.a. I believe this function is actually in libcrypto, so you may also need to specify this library.

< p>g server.cpp -L /usr/lib -lssl -lcrypto -o server

I am trying to use openssl in a gcc program, but it does not work.

g++ server.cpp /usr/lib/libssl.a -o server

gives an error message, just like the -l option .What do I have to type on the command line to link with openssl? The file /usr/lib/libssl.a exists, but I still get the linker error. No such function MD5() exists.

In the case of the exact error seen, it is difficult to provide an accurate solution. This is my best attempt.

Based on the information you provided, it sounds like the linker failed because it Cannot find a reference to the md5 function in libssl.a. I believe this function is actually in libcrypto, so you may also need to specify this library.

g server.cpp -L /usr/lib -lssl -lcrypto -o server

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2161 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.