2016-04-05 15 views
-4

Yazılım için bir eklenti yapmak istiyorum. Eklentiyi yapabilmek için .dll dosyasını yapmalıyım ama bunu yapmakla ilgili birçok zorlukla karşılaştım. Sistemim Windows 7 ve Microsoft Visual Studio 2010'u bir IDE olarak kullanıyorum. Bir dll projesi yaptım ve iki kaynak dosya, bir başlık dosyası hazırladım ve sonra çözümü kurdum ancak aşağıdaki hatalarla karşılaştım.Hata nasıl çözülür: LNK2019: çözümlenmemiş harici sembol "public"?

Not: çözümü oluşturmadan önce, yazılımın içerme ve lib dizinlerinin yolunu ekledim.

1>  Creating library C:\Users\pars\Desktop\example\FEneohookean\Debug\FEneohookean.lib and object C:\Users\pars\Desktop\example\FEneohookean\Debug\FEneohookean.exp 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall FECoreFactory::~FECoreFactory(void)" ([email protected]@[email protected]) referenced in function __ 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: void __thiscall FECoreKernel::RegisterClass(class FECoreFactory *)" ([email protected]@@[email protected]@@Z) referenced in function "public: __thiscall FERegisterClass_T<class FENeoHookeanPI>::FERegisterClass_T<class FENeoHookeanPI>(unsigned int,char const *)" ([email protected]@@@@[email protected]@Z) 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: static class FECoreKernel & __cdecl FECoreKernel::GetInstance(void)" ([email protected]@@[email protected]) referenced in function "public: __thiscall FERegisterClass_T<class FENeoHookeanPI>::FERegisterClass_T<class FENeoHookeanPI>(unsigned int,char const *)" ([email protected]@@@@[email protected]@Z) 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: __thiscall FECoreFactory::FECoreFactory(unsigned int,char const *)" ([email protected]@[email protected]@Z) referenced in function "public: __thiscall FERegisterClass_T<class FENeoHookeanPI>::FERegisterClass_T<class FENeoHookeanPI>(unsigned int,char const *)" ([email protected]@@@@[email protected]@Z) 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: __thiscall FEElasticMaterial::FEElasticMaterial(class FEModel *)" ([email protected]@[email protected]@@@Z) referenced in function "public: __thiscall FENeoHookeanPI::FENeoHookeanPI(class FEModel *)" ([email protected]@[email protected]@@@Z) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual class FEParam * __thiscall FEMaterial::GetParameter(class ParamString const &)" ([email protected]@@[email protected]@[email protected]@@Z) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall FEMaterial::Serialize(class DumpFile &)" ([email protected]@@[email protected]@@Z) 
1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall FEElasticMaterial::SetAttribute(char const *,char const *)" ([email protected]@@[email protected]) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall FEElasticMaterial::SetAttribute(char const *,char const *)" ([email protected]@@[email protected]) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall FEMaterial::Properties(void)" ([email protected]@@UAEHXZ) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual class FECoreBase * __thiscall FEMaterial::GetProperty(int)" ([email protected]@@[email protected]@[email protected]) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall FEMaterial::FindPropertyIndex(char const *)" ([email protected]@@[email protected]) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall FEMaterial::SetProperty(int,class FECoreBase *)" ([email protected]@@[email protected]@@Z) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall FESolidMaterial::Density(void)" ([email protected]@@UAENXZ) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall FEElasticMaterial::SetLocalCoordinateSystem(class FEElement &,int,class FEMaterialPoint &)" ([email protected]@@[email protected]@[email protected]@@Z) 
    1>dllmain.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall FEElasticMaterial::StrainEnergyDensity(class FEMaterialPoint &)" ([email protected]@@[email protected]@@Z) 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: __thiscall FEElasticMaterialPoint::FEElasticMaterialPoint(void)" ([email protected]@[email protected]) referenced in function "public: virtual class FEMaterialPoint * __thiscall FEElasticMaterial::CreateMaterialPointData(void)" ([email protected]@@[email protected]@XZ) 
    1>dllmain.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall FEElasticMaterial::~FEElasticMaterial(void)" ([email protected]@[email protected]) referenced in function "public: virtual __thiscall FENeoHookeanPI::~FENeoHookeanPI(void)" ([email protected]@[email protected]) 
    1>FENeoHookeanPI.obj : error LNK2019: unresolved external symbol "protected: void __thiscall FEParamContainer::AddParameter(void *,enum FEParamType,int,class RANGE,char const *)" ([email protected]@@[email protected]@[email protected]@[email protected]) referenced in function "protected: virtual void __thiscall FENeoHookeanPI::BuildParamList(void)" ([email protected]@@MAEXXZ) 
    1>FENeoHookeanPI.obj : error LNK2019: unresolved external symbol "protected: virtual void __thiscall FESolidMaterial::BuildParamList(void)" ([email protected]@@MAEXXZ) referenced in function "protected: virtual void __thiscall FENeoHookeanPI::BuildParamList(void)" ([email protected]@@MAEXXZ) 
    1>FENeoHookeanPI.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall FEElasticMaterial::Init(void)" ([email protected]@@UAEXXZ) referenced in function "public: virtual void __thiscall FENeoHookeanPI::Init(void)" ([email protected]@@UAEXXZ) 
    1>FENeoHookeanPI.obj : error LNK2019: unresolved external symbol "public: class mat3ds __thiscall FEElasticMaterialPoint::LeftCauchyGreen(void)" ([email protected]@@[email protected]@XZ) referenced in function "public: virtual class mat3ds __thiscall FENeoHookeanPI::Stress(class FEMaterialPoint &)" ([email protected]@@[email protected]@[email protected]@@Z) 
    1>C:\Users\pars\Desktop\example\FEneohookean\Debug\FEneohookean.dll : fatal error LNK1120: 21 unresolved externals 
    1> 
    1>Build FAILED 

Bu hataları nasıl çözebilirim?

+0

Hope [this] (http://stackoverflow.com/questions/14289170/lnk1120-1-unresolved-externalsand-lnk2019-unresolved-external-symbol?rq=1) yardımcı olur – GAVD

cevap

0

Proje ayarına kitaplık yolunun eklenmesine ek olarak, gerekli kitaplık dosyalarını (.lib) ekleyiciye ek bir bağımlılık olarak eklediğinizden emin olun. ek bağımlılık girdi alanını proje-> özellikler-> linker-> Girdi'de bulabilir ve bir boşlukla ayrılmış kitaplık dosyalarının gerçek isimlerini (uzantısıyla) ekleyebilirsiniz.

İlgili konular