Subject: Windows linking problem with multithreaded libssh2

Windows linking problem with multithreaded libssh2

From: Jeremy Friesner <jfriesne_at_gmail.com>
Date: Thu, 8 Dec 2011 12:38:10 -0800

Hi all,

I'm working on a multithreaded Qt-based program that uses libssh2. The
program crashes inside crypt_encrypt() sometimes when there are a several
SSH-using threads running at once, so I googled around and found some pages
saying that for multithreaded libssh2 to work reliably, I need to call
CRYPTO_set_locking_callback(), etc, before using libssh2.

Okay, so I did that and got it to compile under MacOS/X, but under Windows
I get link errors from these calls:

Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
main.obj : error LNK2019: unresolved external symbol
_CRYPTO_set_locking_callback referenced in function "void __cdecl
do_crypto_locks_setup(void)" (?do_crypto_locks_setup@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol _CRYPTO_malloc
referenced in function "void __cdecl do_crypto_locks_setup(void)"
(?do_crypto_locks_setup@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol _CRYPTO_num_locks
referenced in function "void __cdecl do_crypto_locks_setup(void)"
(?do_crypto_locks_setup@@YAXXZ)
main.obj : error LNK2019: unresolved external symbol _CRYPTO_free
referenced in function "void __cdecl do_crypto_locks_cleanup(void)"
(?do_crypto_locks_cleanup@@YAXXZ)

Does anyone have an idea about what I might need to do in order to link
these calls under Windows? Is there some other .lib file I need to link
in, or do I need to pass a particular flag to the "perl Configure VC-WIN32"
command to enable these functions, or ???

Thanks,
Jeremy

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-12-08