Greatings! I'm not very experienced in C++. I'm trying to link statically to my libssh2 project. When I connect the dynamic library, everything works. When I try to compile with static, I get the following output:
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>adding resource. type:MANIFEST, name:2, language:0x0409, flags:0x30, size:381
1>LINK : warning LNK4217: symbol 'strncmp' defined in 'libucrtd.lib(strncmp.obj)' is imported by 'libssh2.lib(pem.obj)' in function '_libssh2_pem_parse'
1>LINK : warning LNK4217: symbol 'strncmp' defined in 'libucrtd.lib(strncmp.obj)' is imported by 'libssh2.lib(session.obj)' in function 'session_startup'
1>LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrtd.lib(strncmp.obj)' is imported by 'libssh2.lib(userauth.obj)'
1>LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrtd.lib(strncmp.obj)' is imported by 'libssh2.lib(misc.obj)'
1>LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrtd.lib(strncmp.obj)' is imported by 'libssh2.lib(kex.obj)'
1>LINK : warning LNK4217: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'libssh2.lib(session.obj)' in function 'libssh2_default_free'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'libssh2.lib(wincng.obj)'
1>LINK : warning LNK4286: symbol 'free' defined in 'libucrtd.lib(free.obj)' is imported by 'libssh2.lib(bcrypt_pbkdf.obj)'
1>LINK : warning LNK4217: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'libssh2.lib(session.obj)' in function 'libssh2_default_alloc'
1>LINK : warning LNK4286: symbol 'malloc' defined in 'libucrtd.lib(malloc.obj)' is imported by 'libssh2.lib(wincng.obj)'
1>LINK : warning LNK4217: symbol 'isspace' defined in 'libucrtd.lib(_ctype.obj)' is imported by 'libssh2.lib(userauth.obj)' in function 'memory_read_publickey'
1>LINK : warning LNK4217: symbol 'fclose' defined in 'libucrtd.lib(fclose.obj)' is imported by 'libssh2.lib(userauth.obj)' in function 'file_read_publickey'
1>LINK : warning LNK4217: symbol 'fclose' defined in 'libucrtd.lib(fclose.obj)' is imported by 'libssh2.lib(wincng.obj)' in function '_libssh2_wincng_cipher_init'
1>LINK : warning LNK4217: symbol 'ceil' defined in 'libucrtd.lib(ceil.obj)' is imported by 'libssh2.lib(wincng.obj)' in function '_libssh2_wincng_bignum_set_word'
1>LINK : warning LNK4217: symbol '__stdio_common_vsprintf' defined in 'libucrtd.lib(output.obj)' is imported by 'libssh2.lib(misc.obj)' in function 'vsnprintf'
1>LINK : warning LNK4217: symbol '__stdio_common_vsprintf' defined in 'libucrtd.lib(output.obj)' is imported by 'libssh2.lib(channel.obj)' in function 'time'
1>
1>libssh2.lib(session.obj) : error LNK2019: unresolved external symbol __imp__difftime64 referenced in function difftime
1>libssh2.lib(channel.obj) : error LNK2001: unresolved external symbol __imp__time64
1>libssh2.lib(session.obj) : error LNK2001: unresolved external symbol __imp__time64
1>libssh2.lib(userauth.obj) : error LNK2001: unresolved external symbol __imp__time64
1>libssh2.lib(keepalive.obj) : error LNK2001: unresolved external symbol __imp__time64
1>libssh2.lib(packet.obj) : error LNK2001: unresolved external symbol __imp__time64
1>libssh2.lib(session.obj) : error LNK2019: unresolved external symbol __imp_realloc referenced in function libssh2_default_realloc
1>libssh2.lib(wincng.obj) : error LNK2001: unresolved external symbol __imp_realloc
1>libssh2.lib(userauth.obj) : error LNK2019: unresolved external symbol __imp_feof referenced in function file_read_publickey
1>libssh2.lib(userauth.obj) : error LNK2019: unresolved external symbol __imp_fopen referenced in function file_read_publickey
1>libssh2.lib(wincng.obj) : error LNK2001: unresolved external symbol __imp_fopen
1>libssh2.lib(userauth.obj) : error LNK2019: unresolved external symbol __imp_fread referenced in function file_read_publickey
1>libssh2.lib(userauth.obj) : error LNK2019: unresolved external symbol __imp_rewind referenced in function file_read_publickey
1>libssh2.lib(transport.obj) : error LNK2019: unresolved external symbol __imp__wassert referenced in function _libssh2_transport_read
1>libssh2.lib(channel.obj) : error LNK2001: unresolved external symbol __imp__wassert
1>libssh2.lib(pem.obj) : error LNK2019: unresolved external symbol __imp_fgets referenced in function readline
1>libssh2.lib(bcrypt_pbkdf.obj) : error LNK2019: unresolved external symbol __imp_calloc referenced in function bcrypt_pbkdf
What should I do? In what direction to look for, understand, to solve this problem? The project itself, if necessary, can be found here: https://github.com/KovAlexey/AddInSSHClient Sorry for the bad code and my English.