GetDocument - Linker Fehlermeldung bei Release-Konfig.
-
Hallo,
ich habe eine SDI-Anwendung mit zwei Views (Tree + Form) in einem Splitter-Window erstellt. Läuft auch alles wunderbar, solange die aktive Konfiguration "Debug" ist. Wenn ich die Konfiguration auf "Release" setze, bekomme ich zwei Linker-Fehler:
CDView.obj : error LNK2001: unresolved external symbol "public: class CCDCatalogDoc * __thiscall CCDView::GetDocument(void)" (?GetDocument@CCDView@@QAEPAVCCDCatalogDoc@@XZ) DetailView.obj : error LNK2001: unresolved external symbol "public: class CCDCatalogDoc * __thiscall CDetailView::GetDocument(void)" (?GetDocument@CDetailView@@QAEPAVCCDCatalogDoc@@XZ) Release/CDCatalog.exe : fatal error LNK1120: 2 unresolved externals
In beiden Views habe ich folgenden Code (wurde automatisch erstellt) entdeckt:
///////////////////////////////////////////////////////////////////////////// // CCDView diagnostics #ifdef _DEBUG void CCDView::AssertValid() const { CTreeView::AssertValid(); } void CCDView::Dump(CDumpContext& dc) const { CTreeView::Dump(dc); } CCDCatalogDoc* CCDView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCDCatalogDoc))); return (CCDCatalogDoc*)m_pDocument; } #endif //_DEBUG
So wie ich das sehe, "fliegt" die Funktion "GetDocument" in der Release-Version raus. Aber laut Kommentar im Header sollte sie doch inline sein?!?
Weiss jemand Näheres und wie ich das hinkriegen kann?
Danke im voraus
Gruss
yeti
-
Sorry - konnte den ersten Beitrag nicht mehr editieren - das Problem lag darin, dass ich nicht alles aus dem Beispielcode, den ich verwendet hatte, kopiert hatte.
Tut mir leid, hoffe dass sich niemand zu sehr den Kopf zerbrochen hat.
Gruss
yeti