Windows中未解析的外部符号

时间:2016-06-09 06:12:02

标签: c++ windows visual-studio-2012 intel-pin

我正在使用windows8 32位,visual studio 2012和intel pintool(76991版本)。 我使用developer命令提示符使用命令创建dll:

dtTo

这是错误的:

link /DLL /EXPORT:main /NODEFAULTLIB /NOLOGO /INCREMENTAL:NO /MACHINE:x86 /ENTRY:Ptrace_DllMainCRTStartup /BASE:0xC5000000 /OPT:REF /out:obj-ia32/inscount0.dll inscount0.obj shmem_ritu.obj /LIBPATH:C:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\ia32\lib /LIBPATH:C:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\ia32\lib-ext /LIBPATH:C:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\extras\xed-ia32\lib pin.lib libxed.lib libcpmt.lib libcmt.lib pinvm.lib kernel32.lib C:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\ia32\lib-ext\ntdll-32.lib
cl -c     -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\source\include -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\source\tools\InstLib -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\extras\xed2-ia32\include -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\extras\components\include  -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\source/include/gen -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\source/include/pin -IC:\Users\kunal\Downloads\pin-3.0-76991-msvc-windows\pin-3.0-76991-msvc-windows\source/include/pin/gen     -DTARGET_IA32E -DHOST_IA32E  -DTARGET_WINDOWS  -IC:\minor\filesIncludeInVisualStudio  inscount0.cpp

在互联网上,我发现由于下面提到的原因我可能会收到此错误 "试图在调试模式下构建Pintool。将Visual Studio中的活动配置更新为Release,链接错误将消失"

我需要包含哪个标志才能在发布模式下构建它(因为我正在使用命令提示符)?

1 个答案:

答案 0 :(得分:1)

我不确定这是否仍然需要,但我相信你没有将pintool与crtbeginS.o联系起来。尝试在链接命令中首先添加此目标文件。