在链接V8时修复链接器警告LNK4099

时间:2015-04-20 23:50:59

标签: c++ visual-studio-2013 v8

我正在构建V8(在Windows上,使用Visual Studio 2013)作为共享库(.dll),然后链接到另一个项目中生成的DLL。我正在构建v8的“调试”版本,以及我自己项目的“调试”版本。

但是,在链接时,我收到如下警告:

1>v8_libbase.lib(bits.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(bits.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(cpu.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(cpu.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(logging.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(logging.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(once.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(once.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(time.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(time.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(mutex.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(mutex.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(semaphore.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(semaphore.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(sys-info.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(sys-info.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(random-number-generator.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(random-number-generator.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libbase.lib(platform-win32.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libbase.lib(platform-win32.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libplatform.lib(default-platform.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libplatform.lib(default-platform.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libplatform.lib(task-queue.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libplatform.lib(task-queue.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info
1>v8_libplatform.lib(worker-thread.obj) : warning LNK4099: PDB 'vc120.pdb' was not found with 'v8_libplatform.lib(worker-thread.obj)' or at 'C:\MyWorkingDirectory\Debug\x86\vc120.pdb'; linking object as if no debug info

如何解决这些警告?我理解LNK4099 cannot be suppressed

我使用以下nant代码构建v8。我试图在这里只包括构建的相关部分。

            <!-- Generate the solution & project files using GYP -->
            <exec program="${path.python}" workingdir="${workingdir}">
                <arg value="build\gyp_v8" />
                <arg value="-Dtarget_arch=x64" if="${platform == 'x64'}" />
                <arg value="-Dcomponent=shared_library" /> <!-- Build dlls, not static-linking libs. -->
                <arg value="-Dv8_enable_i18n_support=false" /> <!-- Disable i18n, only so that we don't need to ship and link ICU binaries with v8. -->
                <arg value="-Dv8_use_snapshot=true" /> <!-- Snapshots are a desirable feature for performance, but disable snapshots if the resulting binary is unstable. Disabled in Node.js for stability. -->
                <arg line="-G msvs_version=2013" /> <!-- Produce VS2013 project files. http://bit.ly/1zfNGfc -->
            </exec>



        <!-- Build each of the important projects. -->
        <foreach item="String" in="v8,v8_libplatform" delim="," property="project">
            <echo message="Building project ${project}." />

            <!-- Invoke msbuild to build the project-->
            <exec program="${tool_msbuild}" workingdir="${workingdir}">
                <arg value="tools\gyp\${project}.vcxproj" />
                <arg value='/t:Build' />
                <arg value='/p:Configuration="${buildConfig}"' />
                <arg value="/p:Platform=${nativePlatform}" />
                <arg value="/p:BuildInParallel=true" />
                <arg value="/m" />
                <arg value="/nologo" />
            </exec>
        </foreach>

每个库都生成自己的,独立的“vc120.pdb”,并且(我认为)我需要链接“v8_libbase”和“v8_libplatform”以构建我的项目,所以很遗憾我不能简单地复制“vc120.pdb” “到视觉工作室会找到它。

0 个答案:

没有答案