gcc error "undefined reference to ..."

Hi!

I'm using cygwin shell and I try to compile a program. During the compilation gcc shows error - undefined reference to 'RC4', 'MD5_init', 'd21_509', etc. I've install ssl, but it isn't help. Have you got any idea, what can be wrong?

THX
Piotrek

Comments

  • : I'm using cygwin shell and I try to compile a program. During the compilation gcc shows error - undefined reference to 'RC4', 'MD5_init', 'd21_509', etc. I've install ssl, but it isn't help. Have you got any idea, what can be wrong?

    All this functions are in libraries, where could be in /usr/lib/ or somewhere else. See where u installed ssl. So, u need to link this libraries to your code. Option -L tell gcc to where look for libraries.
    For example, I have MySQL installed in /usr/local/mysql & its libraries in /usr/local/mysql/lib/. For linking with libmysqlclient.a I do:

    g++ -L/usr/local/mysql/lib my_prog.C -lmysqlclient

    Lekha

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion