Discussion:
error LNK2001: unresolved external symbol "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA) - using VS 2005
(too old to reply)
Sankaran
2009-12-11 12:20:02 UTC
Permalink
Hello Everyone,

I am trying to create a .DLL using VS 2005. While linking, I am
getting the following error;
-----------------------------------------------------------------------------------------------------------
error LNK2001: unresolved external symbol "unsigned int (__stdcall*
ATL::g_pfnGetThreadACP)(void)" (?***@ATL@@3P6GIXZA)
-----------------------------------------------------------------------------------------------------------
I searched and found few answers like "all the dependent modules
should be built with VS 2005", "Link atls.lib".
I have tried the above steps and tried including few Windows header
files as suggested in few forums as an answer to the
same issue. Unfortunately, nothing works out !

To brief: I have few .LIB files, which will be linked and finally I
will be getting a .DLL file. I am building these modules (.LIB
and .DLL) in VS 2005. This is a non-MFC DLL.

Any suggestions are really appreciable!

Best regards,
Sankaran
Burkhardt Braun
2009-12-11 13:44:38 UTC
Permalink
Hello!
Post by Sankaran
Hello Everyone,
I am trying to create a .DLL using VS 2005. While linking, I am
getting the following error;
-----------------------------------------------------------------------------------------------------------
error LNK2001: unresolved external symbol "unsigned int (__stdcall*
-----------------------------------------------------------------------------------------------------------
I searched and found few answers like "all the dependent modules
should be built with VS 2005", "Link atls.lib".
I have tried the above steps and tried including few Windows header
files as suggested in few forums as an answer to the
same issue. Unfortunately, nothing works out !
To brief: I have few .LIB files, which will be linked and finally I
will be getting a .DLL file. I am building these modules (.LIB
and .DLL) in VS 2005. This is a non-MFC DLL.
Any suggestions are really appreciable!
1. So I wrote a program like this
#include <atlbase.h>
#include <stdio.h>
int main( void )
{
printf( "%p\n", g_pfnGetThreadACP );
return( 0 );
}

2. I compiled it with cl test.cpp -link /verbose:lib

3. It produced the following output:
00401083

So the program works fine.

4. Now: The searched libraries should be the same as in your
environment. They are:
Searching libraries
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\uuid.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB
\atls.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\kernel32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\user32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\advapi32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\ole32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\shell32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\oleaut32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\shlwapi.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\LIBCMT.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\OLDNAMES.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\uuid.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB
\atls.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\LIB
\kernel32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\user32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\advapi32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\ole32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\shell32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\oleaut32.lib:
Searching D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\lib\shlwapi.lib:

It is a good idea that you try produce the same steps as above and to
approximate
the above source and compiler flags to your code.

Kind regards
Burkhardt Braun

Loading...