By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,361 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,361 IT Pros & Developers. It's quick & easy.

Mass of 'already defined' errors on compilation.

P: 71
During the linking I get the following:

1>Linking...
1>main.obj : error LNK2005: "double __cdecl sigma(class curious2007::pair<double,double> const &)" (?sigma@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl sigma_linear(struct std::pair<double,double> const &)" (?sigma_linear@@YANABU?$pair@NN@std@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl mu(class curious2007::pair<double,double> const &)" (?mu@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl forcing(class curious2007::pair<double,double> const &)" (?forcing@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl b(class curious2007::pair<double,double> const &)" (?b@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC(double const &)" (?IC@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_put(double const &)" (?IC_put@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_PO(double const &)" (?IC_PO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_ASCPO(double const &)" (?IC_ASCPO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_SCPO(double const &)" (?IC_SCPO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR(double const &)" (?BCR@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_PO(double const &)" (?BCR_PO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCL(double const &)" (?BCL@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCL_put(double const &)" (?BCL_put@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_Topper_p11(double const &)" (?BCR_Topper_p11@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_Topper_p10(double const &)" (?BCR_Topper_p10@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2019: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function "public: __thiscall _bstr_t::Data_t::Data_t(char const *)" (??0Data_t@_bstr_t@@QAE@PBD@Z)
1>main.obj : error LNK2019: unresolved external symbol "char * __stdcall _com_util::ConvertBSTRToString(wchar_t *)" (?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function "public: char const * __thiscall _bstr_t::Data_t::GetString(void)const " (?GetString@Data_t@_bstr_t@@QBEPBDXZ)
1>main.obj : error LNK2019: unresolved external symbol "long __cdecl _com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned short,void *,wchar_t const *,...)" (?_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_ WZZ) referenced in function "public: class _com_ptr_t<class _com_IIID<struct Excel::_Workbook,&struct __s_GUID const _GUID_000208da_0000_0000_c000_000000000046> > __thiscall Excel::_Application::GetActiveWorkbook(void)" (?GetActiveWorkbook@_Application@Excel@@QAE?AV?$_c om_ptr_t@V?$_com_IIID@U_Workbook@Excel@@$1?_GUID_0 00208da_0000_0000_c000_000000000046@@3U__s_GUID@@B @@@@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DoubleSweep<double,long>::~DoubleSweep<double,long >(void)" (??1?$DoubleSweep@NJ@@UAE@XZ) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: class Vector<double,long,class FullArray<double,class std::allocator<double> > > __thiscall DoubleSweep<double,long>::solve(void)" (?solve@?$DoubleSweep@NJ@@QAE?AV?$Vector@NJV?$Full Array@NV?$allocator@N@std@@@@@@XZ) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall DoubleSweep<double,long>::DoubleSweep<double,long> (class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,double const &,double const &)" (??0?$DoubleSweep@NJ@@QAE@ABV?$Vector@NJV?$FullArr ay@NV?$allocator@N@std@@@@@@000ABN1@Z) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>C:\Users\admin\Documents\Visual Studio 2005\Projects\vec\Debug\vec.exe : fatal error LNK1120: 6 unresolved externals


I would appreciate any help as to how to handle this.
Sep 7 '07 #1
Share this Question
Share on Google+
2 Replies


P: 44
During the linking I get the following:

1>Linking...
1>main.obj : error LNK2005: "double __cdecl sigma(class curious2007::pair<double,double> const &)" (?sigma@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl sigma_linear(struct std::pair<double,double> const &)" (?sigma_linear@@YANABU?$pair@NN@std@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl mu(class curious2007::pair<double,double> const &)" (?mu@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl forcing(class curious2007::pair<double,double> const &)" (?forcing@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl b(class curious2007::pair<double,double> const &)" (?b@@YANABV?$pair@NN@curious2007@@@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC(double const &)" (?IC@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_put(double const &)" (?IC_put@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_PO(double const &)" (?IC_PO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_ASCPO(double const &)" (?IC_ASCPO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl IC_SCPO(double const &)" (?IC_SCPO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR(double const &)" (?BCR@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_PO(double const &)" (?BCR_PO@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCL(double const &)" (?BCL@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCL_put(double const &)" (?BCL_put@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_Topper_p11(double const &)" (?BCR_Topper_p11@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2005: "double __cdecl BCR_Topper_p10(double const &)" (?BCR_Topper_p10@@YANABN@Z) already defined in Characteristics.obj
1>main.obj : error LNK2019: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function "public: __thiscall _bstr_t::Data_t::Data_t(char const *)" (??0Data_t@_bstr_t@@QAE@PBD@Z)
1>main.obj : error LNK2019: unresolved external symbol "char * __stdcall _com_util::ConvertBSTRToString(wchar_t *)" (?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function "public: char const * __thiscall _bstr_t::Data_t::GetString(void)const " (?GetString@Data_t@_bstr_t@@QBEPBDXZ)
1>main.obj : error LNK2019: unresolved external symbol "long __cdecl _com_dispatch_method(struct IDispatch *,long,unsigned short,unsigned short,void *,wchar_t const *,...)" (?_com_dispatch_method@@YAJPAUIDispatch@@JGGPAXPB_ WZZ) referenced in function "public: class _com_ptr_t<class _com_IIID<struct Excel::_Workbook,&struct __s_GUID const _GUID_000208da_0000_0000_c000_000000000046> > __thiscall Excel::_Application::GetActiveWorkbook(void)" (?GetActiveWorkbook@_Application@Excel@@QAE?AV?$_c om_ptr_t@V?$_com_IIID@U_Workbook@Excel@@$1?_GUID_0 00208da_0000_0000_c000_000000000046@@3U__s_GUID@@B @@@@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall DoubleSweep<double,long>::~DoubleSweep<double,long >(void)" (??1?$DoubleSweep@NJ@@UAE@XZ) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: class Vector<double,long,class FullArray<double,class std::allocator<double> > > __thiscall DoubleSweep<double,long>::solve(void)" (?solve@?$DoubleSweep@NJ@@QAE?AV?$Vector@NJV?$Full Array@NV?$allocator@N@std@@@@@@XZ) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall DoubleSweep<double,long>::DoubleSweep<double,long> (class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,class Vector<double,long,class FullArray<double,class std::allocator<double> > > const &,double const &,double const &)" (??0?$DoubleSweep@NJ@@QAE@ABV?$Vector@NJV?$FullArr ay@NV?$allocator@N@std@@@@@@000ABN1@Z) referenced in function "public: void __thiscall ParabolicFDM<double,double,double>::advance(void)" (?advance@?$ParabolicFDM@NNN@@QAEXXZ)
1>C:\Users\admin\Documents\Visual Studio 2005\Projects\vec\Debug\vec.exe : fatal error LNK1120: 6 unresolved externals


I would appreciate any help as to how to handle this.


hi,

I guess you are trying to write Dll or you are working in multy threded invironment,

check your setting,

Projects ---->setting----->C++-----><<Select category>> CodeGeneration
<<and change use-runtime library to>> Multithreded Dll

and rebuilt your code.
it might work.

thanks
Abhinay
Sep 9 '07 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
Read this.

You may have more than one issue.
Sep 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.