[cmake-developers] depend problem on windows

Peter Collingbourne peter at pcc.me.uk
Sat Mar 17 20:26:08 EDT 2012


On Thu, Mar 15, 2012 at 10:24:49AM -0400, Bill Hoffman wrote:
> So, I did a git branch switch to next and ran ninja on my build tree. It 
> correctly re-ran cmake.  But I found a link error building cmake-gui:
>
>
> CMakeLib.lib(cmLocalVisualStudio10Generator.cxx.obj) : error LNK2001:  
> unresolved external symbol "public: virtual void __thiscall  
> cmLocalVisualStudio7Generator::GetTargetObjectFileDirectories(class  
> cmTarget *,class std::vector<class std::basic_string<char,struct  
> std::char_traits<char>,class std::allocator<char> >,class  
> std::allocator<class std::basic_string<char,struct  
> std::char_traits<char>,class std::allocator<char> > > > &)"  
> (?GetTargetObjectFileDirectories at cmLocalVisualStudio7Generator@@UAEXPAVcmTarget@@AAV?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@@Z)
> bin\cmake-gui.exe : fatal error LNK1120: 1 unresolved externals
> LINK Pass 1 failed. with 2
>
>
> I did a ninja -t clean, and then ninja and everything worked.  So, it  
> looks like some of the object files did not rebuild correctly after the  
> branch switch.  Same source tree worked with a gmake build tree, so  
> there were no odd file time things going on.

Most likely some object files were not rebuilt as a result of header
file changes.  This will happen if the compiler does not support
emitting dependency files, such as cl.exe.  I think there are a couple
of ways we could consider supporting cl.exe here:

1) Integrate CMake's built in dependency scanner.  This will require
   some thought because the dependency scanner works on a per-target
   basis and Ninja reads dependency files on a per-file basis.

2) Come up with a way to use cl.exe's /showIncludes option to build a
   dependency list.  There has been some discussion of this topic on
   the Ninja mailing list:
   https://groups.google.com/group/ninja-build/search?group=ninja-build&q=showincludes&qt_g=Search+this+group

Thanks,
-- 
Peter



More information about the cmake-developers mailing list