Visual Studio C++ 2010 Link Error -



Visual Studio C++ 2010 Link Error -

i'm getting several error lnk2019: unresolved external symbol errors, they're not due dlls, libs, or oo errors in every other stackoverflow post link error.

code:

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

trace:

1>------ build started: project: cachedump, configuration: release win32 ------ 1>link : warning lnk4075: ignoring '/incremental' due '/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:\users\andrew\desktop\src\fgdump\cachedump\release\cachedump.exe : fatal error lnk1120: 5 unresolved externals ========== build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

abc

.c files compiled cl c code, while .cpp files compiles c++ code. due difference of symbols definitions in c , c++ code c++ code can't see functions c code.

use extern "c" wrapper in headers, or improve utilize same language whole project

to create extern "c" wrapper utilize next template

#ifdef __cplusplus extern "c" { #endif //put c-function declarations here #ifdef __cplusplus } #endif

c++ visual-studio linker lnk2019

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -