0

I upgraded a project from VS 2008 to 2015. In VS 2008 everything was alright but in newest version I have some troubles with compilation. ERROR:

Warning LNK4098 defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library UserInterface
Error   LNK2001 unresolved external symbol "public: void __thiscall SpherePack::LostChild(class SpherePack *)" (?LostChild@SpherePack@@QAEXPAV1@@Z) UserInterface   E:\DEV\launcher\UserInterface\eterlib.lib(GrpObjectInstance.obj)

That function specified in error doesn't missing.

    void SpherePack::LostChild(SpherePack *t)
{
    assert(mChildCount);
    assert(mChildren);

#ifdef _DEBUG  // debug validation code.

    SpherePack *pack = mChildren;
    bool found = false;
    while (pack)
    {
        if (pack == t)
        {
            assert(!found);
            found = true;
        }
        pack = pack->_GetNextSibling();
    }
    assert(found);

#endif

    // first patch old linked list.. his previous now points to his next
    SpherePack *prev = t->_GetPrevSibling();

    if (prev)
    {
        SpherePack *next = t->_GetNextSibling();
        prev->SetNextSibling(next); // my previous now points to my next
        if (next) next->SetPrevSibling(prev);
        // list is patched!
    }
    else
    {
        SpherePack *next = t->_GetNextSibling();
        mChildren = next;
        if (mChildren) mChildren->SetPrevSibling(0);
    }

    mChildCount--;

    if (!mChildCount && HasSpherePackFlag(SPF_SUPERSPHERE))
    {
        mFactory->Remove(this);
    }
}

Thanks in advance!

  • Are you sure the file with the above method is included in the build? Try adding a syntax error in your method to check that. – PMF Jun 17 '16 at 05:57
  • assert(mChildCount) assert(mChildren); Error (active) incomplete type is not allowed SphereLib –  Jun 17 '16 at 06:00
  • Is this all in the same library? Have you tried a rebuild? Do other methods work? – PMF Jun 17 '16 at 06:04
  • I've recompiled a lot of times but nothing happen. –  Jun 17 '16 at 06:06
  • 1
    Problem might be because the library is compiled with different options than the exe, also see the warning: they seem to link against different runtime libraries – stijn Jun 17 '16 at 06:36

0 Answers0