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@cmLocalVisualStudio7Generator@@UAEXPAVcmTarget@@AAV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@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 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers