Hi,
I have a problem trying to start my pintool built with WinSock library (ws2_32.lib) - it immediately exits with message "Failure to open DLL file WS2_32.dll".
I've prepared a simple pintool to illistrate the problem:
//----------------------------------------------------------
#include "pin.H"
namespace WINDOWS
{
#include <Ws2tcpip.h>
void *p = WSAStartup;
};
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) return 1;
PIN_StartProgram();
return 0;
}
I've placed this file to a subdirectory of source\tools, added to makefile.rules the following line
TOOL_LIBS := ${TOOL_LIBS} ws2_32.lib
built the pintool
make -B TARGET=ia32
then tried to run with the following command:
..\..\..\pin.exe -t obj-ia32\sock_tool.dll -- c:\windows\System32\cmd /c echo ****** started Ok ******
and have got the following message:
E: Failure to open DLL file Z:\pin-2.14-71313\source\tools\sock_tool\obj-ia32\WS2_32.dll
E: System error 2 : The system cannot find the file specified.
E: Failure to initialize DLL Z:\pin-2.14-71313\source\tools\sock_tool\obj-ia32\sock_tool.dll
E: See preceding message to find out the reason
Could you please explain me what I'm doing wrong?
With the previous versions of PIN this pintool works Ok.
When I remove the line "void *p = WSAStartup;" from the source and rebuild the pintool works Ok with pin-2.14-71313 too.
Any help would be greatly appreciated.
Thanks in advance,
Pavel
OS: Windows 7
compiler: Visual Studio 2010