Final VS2010 binds the project to "rebuild all" only, not "build changed"
I just migrated a solution containing C ++ and C # projects from VS2008 to VS2010 and a weird problem occurred.
When I choose "rebuild all", everything compiles and links as I would expect it to.
Then I change some C ++ source file (just add a space), build a project, I get several thousand linking errors like:
GDlgPackerListe.obj : error LNK2028: Nicht aufgelöstes Token (0A0000C7) ""public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z)", auf das in Funktion ""public: virtual void __thiscall LRcPackerListe::HookRunReport(class LFortschritt &)" (?HookRunReport@LRcPackerListe@@$$FUAEXAAVLFortschritt@@@Z)" verwiesen wird.
Db_Lieferschein2.obj : error LNK2020: Nicht aufgelöstes Token (0A0000E6) "public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z).
bmed.obj : error LNK2028: Nicht aufgelöstes Token (0A00014D) ""public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z)", auf das in Funktion ""public: virtual long __thiscall MENUKB::Methode(long,long)" (?Methode@MENUKB@@$$FUAEJJJ@Z)" verwiesen wird.
GDlgPackerListe.obj : error LNK2028: Nicht aufgelöstes Token (0A0000C9) ""public: void __thiscall LList::Sort(void)" (?Sort@LList@@$$FQAEXXZ)", auf das in Funktion ""public: virtual void __thiscall LRcPackerListe::HookRunReport(class LFortschritt &)" (?HookRunReport@LRcPackerListe@@$$FUAEXAAVLFortschritt@@@Z)" verwiesen wird.
Dlg_Gutschrift.obj : error LNK2020: Nicht aufgelöstes Token (0A000128) "public: virtual __thiscall LBaseType::~LBaseType(void)" (??1LBaseType@@$$FUAE@XZ).
Module_Damals.lib(svSuchAltLink.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall SView::SView(void)" (??0SView@@QAE@XZ)".
Module_Damals.lib(svShowEMF.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall SView::HookValueChanged(unsigned __int64)" (?HookValueChanged@SView@@UAEX_K@Z)".
When I click "rebuild all" it will recompile and link without any errors or even warnings and create a working exe.
I am using the final version of Visual Studio 2010 (German version).
What's going on here? Or, more importantly, how can I get the linker to work correctly?
a source to share
Well, after some head gets scratched, we seem to have found the answer. The problems, in our case, were at least twofold:
-
We installed project dependencies, but did not use the new project references for projects as a means of linking projects to a target. It seems like the old dependency dialog doesn't fit anymore.
-
We had some dubious code that filled in where the virtual function was defined, but not implemented in the derived class - the base class had a default implementation. Why is it not an error in restoring everything I don't know.
Things are better explained below than me: http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx
a source to share