Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6915241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:27:03+00:00 2026-05-27T09:27:03+00:00

I’m working on a multithreaded multi-platform Qt-based program that uses libssh2. The program was

  • 0

I’m working on a multithreaded multi-platform Qt-based program that uses libssh2. The program was occasionally crashing inside crypt_encrypt() and libssh2_transport_write() when several SSH-using threads were active at once, so I googled around and found some pages that say that for multithreaded libssh2 to work reliably, I need to call CRYPTO_set_locking_callback(), etc, before using libssh2.

Based on that advice I added the specified callback-setup calls to the top of main() and got it all to compile and run without crashing under MacOS/X… but under Windows I now get the following link errors that I’m not sure how to fix.

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:27:04+00:00Added an answer on May 27, 2026 at 9:27 am

    I’m not sure if this can help, but this link:
    http://www.lurklurk.org/linkers/linkers.html

    list some diferences between linking on unixes and windows

    An excerpt:

    The most major difference between the two is that symbols are not
    automatically exported by Windows libraries. On Unix, all of the
    symbols from all of the object files that were linked into the shared
    library are visible to users of the library. On Windows, the
    programmer has to explicitly choose to make particular symbols
    visible—i.e. to export them.

    There are three ways to export a symbol from a Windows DLL (and all
    three ways can be mixed together in the same library).

    In the source code, declare the symbol as `__declspec(dllexport)`, thusly:
    

    __declspec(dllexport) int my_exported_function(int x, double y);

    On the invocation of the linker, use the /export:symbol_to_export option to LINK.EXE.
    
        LINK.EXE /dll /export:my_exported_function
    
    Get the linker to pull in a module definition (.DEF) file (by using the /DEF:def_file linker option), and in that file include an
    

    EXPORTS section that contains the symbols you want to export.

        EXPORTS
          my_exported_function
          my_other_exported_function
    

    What would be left is to ask the MacOSX devs to search for those functions and tell you which specific library has those functions, recheck the code, redeclare if you can and try again.

    Sorry that I could not pin point exactly what is your problem.

    Also keep in mind that Visual Studio is a C++ compiler, not a C compiler, and while it is almost C90 compliant, the libssh libraries or others could use some C99 constructs which VS does not support.

    I hope this can somehow help you to find your way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.