Link errors after switching to VS2010

328 views
Skip to first unread message

Dominic Mazzoni

unread,
May 17, 2012, 12:38:09 PM5/17/12
to chromium-dev
I just upgraded to VS2010 and I'm having trouble linking. A ninja build of chrome.exe works great, so I'm pretty sure I have all of the SDKs installed correctly - but but when I try to build with either the Visual Studio IDE or msbuild from the command line, I get a bunch of linker errors that I've never seen before. Any help would be appreciated!

First, my relevant environment variables:

GYP_GENERATORS=ninja,msvs
GYP_MSVS_VERSION=2010
VS100COMNTOOLS=c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\

And PATH contains these relevant directories in this order:

d:\src\depot_tools\
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
C:\Python27
d:\src\chromium\src\third_party\platformsdk_win7\files\Bin

Currently, I have GYP_DEFINES empty, because I wanted to make sure the error wasn't related to a component build or incremental linking. I got the same errors with the flags recommended on the site.

I'm trying to run (from Visual Studio Command Prompt): msbuild.exe some.sln /p:Configuration=Debug /p:Platform=Win32 /m

Here's a sample of the error messages (there are 100 LNK errors in total, presumably before it gives up):

         D:\src\gitchrome\src\build\Debug\obj\ncval_base_x86_32\error_reporter.obj /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat 
   653>snapshot-empty.obj : error LNK2005: "private: static unsigned char const * const v8::internal::Snapshot::data_" (?data_@Snapshot@internal@v8@@0QBEB) already defined in snapshot.obj
   653>snapshot-empty.obj : error LNK2005: "private: static unsigned char const * const v8::internal::Snapshot::raw_data_" (?raw_data_@Snapshot@internal@v8@@0PBEB) already defined in snapshot.obj
  ...
  653>ShaderLang.obj : error LNK2005: _ShGetActiveUniform already defined in ShaderLang.obj
  653>ppp_entrypoints.obj : error LNK2019: unresolved external symbol "class pp::Module * __cdecl pp::CreateModule(void)" (?CreateModule@pp@@YAPAVModule@1@XZ) referenced in function _PPP_InitializeModule
   653>..\build\Debug\initial\chrome.dll : fatal error LNK1120: 4 unresolved externals
   653>Done building target "Link" in project "chrome_main_dll.vcxproj" -- FAILED.
   653>Done Building Project "D:\src\gitchrome_metro\src\chrome\chrome_main_dll.vcxproj" (default targets) -- FAILED.
   298>Done executing task "MSBuild" -- FAILED.
   298>Done building target "Build" in project "chrome_main_dll.vcxproj.metaproj" -- FAILED.
   298>Done Building Project "D:\src\gitchrome_metro\src\build\..\chrome\chrome_main_dll.vcxproj.metaproj" (default targets) -- FAILED.
   506>Project "D:\src\gitchrome_metro\src\build\..\chrome_frame\npchrome_frame.vcxproj.metaproj" (506) is building "D:\src\gitchrome_metro\src\build\..\chrome\chrome_main_dll.vcxproj.metaproj" (298:2) on node 1 (default targets).
 298:2>Building with tools version "4.0".
       Target "Build" skipped. Previously built unsuccessfully.

In a different directory, I tried running gclient runhooks from the same Visual Studio command prompt instead of from console2, and I set GYP_DEFINES="component=shared_library incremental_chrome_dll=1", and here I get different errors, such as:

 160:18>base_static.lib(base_switches.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in utf_string_conversions.obj
 160:18>base_static.lib(pe_image.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in utf_string_conversions.obj
 160:18>allocator_extension_thunks.lib(allocator_extension_thunks.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in utf_string_conversions.obj
 160:18>modp_b64.lib(modp_b64.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in utf_string_conversions.obj
 160:18>trace_event_impl.obj : error LNK2001: unresolved external symbol _AnnotateHappensAfter
 160:18>trace_event_win.obj : error LNK2001: unresolved external symbol _AnnotateHappensAfter
 160:18>stack_trace_win.obj : error LNK2019: unresolved external symbol _AnnotateHappensAfter referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<struct std::ch
  ...
         ..\build\Debug\base.dll : fatal error LNK1120: 6 unresolved externals

I hope something here jumps out at someone. Thanks!
- Dominic

Jói Sigurðsson

unread,
May 17, 2012, 3:56:49 PM5/17/12
to dmaz...@google.com, chromium-dev
Did you modify your MSBuild *user.props files as per step 2.2 of the
VS 2010 instructions?
(http://www.chromium.org/developers/how-tos/build-instructions-windows#TOC-Setting-up-the-environment-for-Visual-Studio-2010)

I think those files may not be used by Ninja but they certainly are
used by Visual Studio.

Cheers,
Jói
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev

Dominic Mazzoni

unread,
May 17, 2012, 6:34:43 PM5/17/12
to Jói Sigurðsson, chromium-dev
I did modify those props...also, I'd expect getting that wrong would have led to an error earlier in the process.

I gave up and reimaged my machine. I'm sure the instructions will work from a clean Win 7 install.

- Dominic
Reply all
Reply to author
Forward
0 new messages