When compiling with /MD, a reference to "func" in your source becomes a reference "__imp__func
" in the object since all the run-time is now held within a DLL. If you try to link with the static libraries LIBC.lib or LIBCMT.lib, you will get LNK2001 on __imp__func
. If you try to link with MSVCxx.lib when compiling without /MD you will not always get LNK2001, but you will likely have other problems.
没说清楚,其实是声明了"__declspec(dllimport)"的函数,编译器尝试链接 __imp__funcname(),导致找不到 symbol。
评论