How to get the header file WTTLog.lib and wttlogger.h for the 64-bit version of WTTLog.DLL

This is a continuation for the stream Unresolved external symbol error that occurs only in 64-bit mode, and not in a 32-bit assembly .

I have VC ++ code (built using VS2008) that uses some static libraries (* .lib files statically linked at compile time).

For ease of understanding, send my EXE code as “AAA.EXE” and send lib files as “A.lib”, b.lib and LOGGER.lib (the library that causes the error below)

Both the AAA.EXE code and the static library code (LOgger.lib) are created using VS2008.

I see that my "AAA.EXE" works fine in the 32-bit version, but it demonstrates the following linker errors when AAA.EXE is built in 64-bit mode.

Copy the linker error again for quick reference:

Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall CWTTLogger::CWTTLogger(void)" ( __imp_??0CWTTLogger@ @ QAE@XZ ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CWTTLogger::~CWTTLogger(void)" ( __imp_??1CWTTLogger@ @ UAE@XZ ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CWTTLogger::CreateLogDevice(unsigned short *,long *)" ( __imp_?CreateLogDevice@CWTTLogger @@ QAEJPAGPAJ@Z ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CWTTLogger::StartTest(unsigned short *,long)" ( __imp_?StartTest@CWTTLogger @@ QAEJPAGJ@Z ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CWTTLogger::EndTest(unsigned short *,unsigned long,unsigned short *,long)" ( __imp_?EndTest@CWTTLogger @@ QAEJPAGK0J@Z ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __cdecl CWTTLogger::Trace(unsigned long,long,...)" ( __imp_?Trace@CWTTLogger @@QAAJKJZZ) 1>Logger.lib(Logger.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CWTTLogger::CloseLogDevice(unsigned short *,long)" ( __imp_?CloseLogDevice@CWTTLogger @@ QAEJPAGJ@Z ) 1>C:\Users\User1\Documents\XYZ\Code\64bit\aaa.exe: fatal error LNK1120: 7 unresolved externals 

Here, CWTTLOgger is the class from the Microsoft-provided wttlogger.h header file.
Logger.lib is my user library where I use Microsoft WTTLog.DLL and the header file corresponding to it is "wttlogger.h".

I figured out the root cause of this linker error. The static library code Logger.lib uses Microsoft WTTLog.DLL, calling the function in this WTTLog.DLL from the header file "wttlogger.h".

Now, these calls when working in the 32-bit AAA.exe file (associated with the Logger.lib static library) work fine (NO linker errors). But when the 64-bit AAA.EXE (associated with the 64-bit Logger.lib) calls the functions in WTTLog.DLL, it gives the linker errors mentioned above.

It is very clear that the WTTLog.DLL / WTTLog.lib library is not a 64-bit or the header file for this library "wttlogger.h" does not match the library definition.

I found WTTLog.DLL for 64-bit in the Windows DDK in "C: \ WinDDK \ Win8-RTM \ Tools \ x64 \ WTTlog.dll". Please correct me if I am wrong.

But where to find the header file corresponding to this 64-bit Wttlog.DLL and the static library corresponding to this DLL "WTTLog.DLL". ??

0
source share

Source: https://habr.com/ru/post/1498905/


All Articles