none
Linker error with undeclared methods RRS feed

  • Pergunta

  • Hello, I'm having a strange linker error using visual studio 6, lets say there is two projects here, project A and project B, project B depends on A, and there is a class defined and exported in A. Theres three workspaces, one with both projects and other two, one for each project. Dependencies are set on the workspace with both projects, and these compile fine (both projects on debug). But, when I compile the projects in the separated workspaces, project B generates and very unexpected linker error, it's an unresolved external referencing a missing method in the class defined in project A, but this method is not declared in that class! At least not explicitly, because the missing methods are copy constructor and copy operator (=), here's my code and error.

    code in project A

    #ifdef DLLIMP_EXPORT_PM
    	#undef DLLIMP_EXPORT_PM
    #endif
    #ifndef STPROJMGR_DLL_EXPORT
    	#define DLLIMP_EXPORT_PM __declspec(dllimport)
    #else
    	#define DLLIMP_EXPORT_PM __declspec(dllexport)
    #endif
    
    
    class DLLIMP_EXPORT_PM StExternalEstElmReactor : public StEstElmReactor  
    {
    public:
    	StExternalEstElmReactor();
    	virtual ~StExternalEstElmReactor();
    
    	virtual void checkedOut(const AcDbObjectId& cloneElmId, const AcDbObjectId& projElmId);
    	virtual void checkedIn(const AcDbObjectId& projElmId, const AcDbObjectId& cloneElmId);
    };
    Errors in project B

    --------------------Configuration: StVistas15 - Win32 Release--------------------
    Linking...
       Creating library .\Release15/StVistas15.lib and object .\Release15/StVistas15.exp
    StVistasUtils.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistas.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistasControl.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistasGlobal.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistasIdArray.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaRefCorte.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaRefElm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaReferenceReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaRefStatic.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaPerfil.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaPerfil2d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaPerfil2dCantDobrada.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaPerfil3d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaElementoObjectReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaNonDrawableElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaPavimento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaDetail.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaElemento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaElementoDrawable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaElementoElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dTopo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dTopoPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista3d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaCorteRepEntity.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dLocacao.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dPavimento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dPavimentoPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2dPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistaRef.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StEstLimViewElm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVista2d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) const StExternalEstElmReactor::`vftable'" (__imp_??_7StExternalEstElmReactor@@6B@)
    StVistasUtils.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAE
    AAV0@ABV0@@Z)
    StVistas.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAEAAV0@
    ABV0@@Z)
    StVistasControl.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistasGlobal.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QA
    EAAV0@ABV0@@Z)
    StVistasIdArray.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistaRefCorte.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistaRefElm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAE
    AAV0@ABV0@@Z)
    StVistaReferenceReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmRe
    actor@@QAEAAV0@ABV0@@Z)
    StVistaRefStatic.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@
    QAEAAV0@ABV0@@Z)
    StVistaPerfil.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAE
    AAV0@ABV0@@Z)
    StVistaPerfil2d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistaPerfil2dCantDobrada.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstEl
    mReactor@@QAEAAV0@ABV0@@Z)
    StVistaPerfil3d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistaElementoObjectReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEst
    ElmReactor@@QAEAAV0@ABV0@@Z)
    StVistaElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmRea
    ctor@@QAEAAV0@ABV0@@Z)
    StVistaNonDrawableElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExtern
    alEstElmReactor@@QAEAAV0@ABV0@@Z)
    StVistaPavimento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@
    QAEAAV0@ABV0@@Z)
    StVistaDetail.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAE
    AAV0@ABV0@@Z)
    StVistaElemento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVistaElementoDrawable.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmRe
    actor@@QAEAAV0@ABV0@@Z)
    StVistaElementoElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalE
    stElmReactor@@QAEAAV0@ABV0@@Z)
    StVista2dTopo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAE
    AAV0@ABV0@@Z)
    StVista2dTopoPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstEl
    mReactor@@QAEAAV0@ABV0@@Z)
    StVista3d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAEAAV0
    @ABV0@@Z)
    StVistaCorteRepEntity.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReac
    tor@@QAEAAV0@ABV0@@Z)
    StVista2dLocacao.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@
    QAEAAV0@ABV0@@Z)
    StVista2dPavimento.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor
    @@QAEAAV0@ABV0@@Z)
    StVista2dPavimentoPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternal
    EstElmReactor@@QAEAAV0@ABV0@@Z)
    StVista2dPredioReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmRea
    ctor@@QAEAAV0@ABV0@@Z)
    StVistaRef.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAEAAV
    0@ABV0@@Z)
    StEstLimViewElm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@Q
    AEAAV0@ABV0@@Z)
    StVista.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAEAAV0@A
    BV0@@Z)
    StVista2d.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class StExternalEstElmReactor & __thiscall StExternalEstElmReactor::operator=(class StExternalEstElmReactor const &)" (__imp_??4StExternalEstElmReactor@@QAEAAV0
    @ABV0@@Z)
    StVista.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static enum Acad::ErrorStatus __cdecl StProjectManager::currentElmToDatabase(class AcDbObjectId &)" (__imp_?currentElmToDatabase@StProjectManager@@SA?AW4ErrorStat
    us@Acad@@AAVAcDbObjectId@@@Z)
    StVistaElementoElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall StExternalEstElmReactor::StExternalEstElmReactor(void)" (__imp_??0StExternalEstElmReactor@@QAE@XZ)
    StVistaElementoElementoReactor.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall StExternalEstElmReactor::~StExternalEstElmReactor(void)" (__imp_??1StExternalEstElmReactor@@UAE@XZ)
    StVistaPerfil2dCantDobrada.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall StExternalEstElmReactor::StExternalEstElmReactor(class StExternalEstElmReactor const &)" (__imp_??0StExternalEstElmReactor@@QAE@ABV0
    @@Z)
    .\Release15\StVistas15.arx : fatal error LNK1120: 6 unresolved externals
    Error executing link.exe.

    StVistas15.arx - 71 error(s), 0 warning(s)

    somebody has a clue?
    sexta-feira, 20 de novembro de 2009 18:23

Todas as Respostas

  • you must define  STPROJMGR_DLL_EXPORT in the Project A's workplace/project.

    It seems that you project isn't exporting the library functions/methods/classes appropriately.

    regards, cox



    cox
    terça-feira, 24 de novembro de 2009 03:05