我正在尝试将MSVC中的问题与我为g ++编写的项目联系起来.这是问题所在:
我将libssh构建为静态库作为我的应用程序的一部分,在cmake中添加目标
add_library(ssh_static STATIC $ libssh_SRCS)
Libssh在C中,所以我有'extern'C"{...}'将包含在我的c ++源代码中.然后我将ssh_static目标链接到我的可执行文件sshconnectiontest
target_link_libraries(sshconnectiontest ... ssh_static ...)
这一切都适用于linux和gcc,但现在在MSVC中我得到了
error LNK2019: unresolved external symbol __imp__[function names here] referenced in [filename]
Run Code Online (Sandbox Code Playgroud)
对于我使用的每个libssh函数.
任何想法都出错了?我已经读过某个地方,imp前缀意味着链接器期望链接.dll,但这不应该是这种情况,因为ssh_static在add_library调用中被声明为静态库...
我正在处理一个现有的c项目(sourceforge上的spglib),我在清理了一些数组初始化后遇到了以下问题:
*检测到glibc* tests/spglibtest:free():下一个大小无效(快):0x08ab46e0***
回溯是:
#0 0xb7fe1424 in __kernel_vsyscall ()
#1 0xb5cfdd61 in raise () from /lib/libc.so.6
#2 0xb5cff5ee in abort () from /lib/libc.so.6
#3 0xb5d397ed in ?? () from /lib/libc.so.6
#4 0xb5d3f7b1 in ?? () from /lib/libc.so.6
#5 0xb5d4052b in ?? () from /lib/libc.so.6
#6 0xb5d441cd in free () from /lib/libc.so.6
#7 0xb6681484 in sym_get_multiplicity (cell=0xbfffe1f0, symprec=0.050000000000000003) at /git/xtalopt-public/src/spglib/symmetry.c:168
#8 0xb6680550 in spg_find_primitive (lattice=0xbfffe2a8, position=0x813c6f0, types=0x813c700, num_atom=2, symprec=0.050000000000000003)
at /git/xtalopt-public/src/spglib/spglib.c:253
Run Code Online (Sandbox Code Playgroud)
错误发生在下面的"免费(反式)"行中:
int sym_get_multiplicity(const Cell *cell, const double symprec)
{
int …Run Code Online (Sandbox Code Playgroud)