English 中文(简体)
视频演播中心 2010年版链接
原标题:Visual Studio C++ 2010 Link Error [closed]

I m 带上几个<代码>error LNK2019:未解决的外部编号差错,但因<代码>dlls、lib或OO差错,如同在StackOverflow的每一个其他员额中,这一链接错误。

法典:

https://github.com/mcandre/fgdump/tree/master/cadatedump

追查:

1>------ Build started: Project: cachedump, Configuration: Release Win32 ------
1>LINK : warning LNK4075: ignoring  /INCREMENTAL  due to  /OPT:ICF  specification
1>cachedump.obj : error LNK2019: unresolved external symbol "void __cdecl rc4_crypt(struct rc4_state *,unsigned char *,int)" (?rc4_crypt@@YAXPAUrc4_state@@PAEH@Z) referenced in function "unsigned long __cdecl DumpCache(void)" (?DumpCache@@YAKXZ)
1>cachedump.obj : error LNK2019: unresolved external symbol "void __cdecl rc4_setup(struct rc4_state *,unsigned char *,int)" (?rc4_setup@@YAXPAUrc4_state@@PAEH@Z) referenced in function "unsigned long __cdecl DumpCache(void)" (?DumpCache@@YAKXZ)
1>cachedump.obj : error LNK2019: unresolved external symbol "void __cdecl md5_finish(struct md5_context *,unsigned char * const)" (?md5_finish@@YAXPAUmd5_context@@QAE@Z) referenced in function "unsigned long __cdecl DumpCache(void)" (?DumpCache@@YAKXZ)
1>cachedump.obj : error LNK2019: unresolved external symbol "void __cdecl md5_update(struct md5_context *,unsigned char *,unsigned long)" (?md5_update@@YAXPAUmd5_context@@PAEK@Z) referenced in function "unsigned long __cdecl DumpCache(void)" (?DumpCache@@YAKXZ)
1>cachedump.obj : error LNK2019: unresolved external symbol "void __cdecl md5_starts(struct md5_context *)" (?md5_starts@@YAXPAUmd5_context@@@Z) referenced in function "unsigned long __cdecl DumpCache(void)" (?DumpCache@@YAKXZ)
1>C:UsersandrewDesktopsrcfgdumpcachedumpReleasecachedump.exe : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

ab

问题回答

<代码>c文档汇编如下:cl/code>,作为C代码,.cpp文档编为。 C++代码。 由于<代码>CC++中的符号定义不同, 页: 1 C++ 代码从<代码>C代码上看。

使用<代码>extern “C” 包裹,或在整个项目中更好地利用相同的语文

采用以下模板:

#ifdef __cplusplus
extern "C"
{
#endif

//put C-function declarations here    

#ifdef __cplusplus
}
#endif




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签