求助求助!!!C++源代码编译成功,组建出现LNK error的问题

诺森德5 诺森德5 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
一个程序,编译显示成功了,但是Linking的时候跳出来78个错误,全是error LNK2001: unresolved external symbol 这种,试了下把工程的设置改了后没有效果。求助各路大神,万分感谢!
--------------------Configuration: Dndc_main - Win32 Debug--------------------
Linking...
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_wb(int,char *,char *)" (?write_out_wb@class_model@@QAEHHPAD0@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::write_globe_summary(int,float,char *,int,int,int,char *,char *,int,int,int,char *,int,int,int,int,int,char *,int,int,int,char (* const)[150],char *,int,i
nt)" (?write_globe_summary@class_model@@QAEXHMPADHHH00HHH0HHHHH0HHHQAY0JG@D0HH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_cropini(int)" (?write_out_cropini@class_model@@QAEHH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::write_BatchSummary(int,char *,char *)" (?write_BatchSummary@class_model@@QAEXHPAD0@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::write_MonteCarlo(int,int,char *)" (?write_MonteCarlo@class_model@@QAEXHHPAD@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_annual_report(int,float,int,int,struct _iobuf *,struct _iobuf *,int,float *,float *,int,char *,char *,char *)" (?write_out_annual_report@class_m
odel@@QAEHHMHHPAU_iobuf@@0HPAM1HPAD22@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_soil_parm(int,int,int)" (?write_out_soil_parm@class_model@@QAEHHHH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::annu_accumu(void)" (?annu_accumu@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::MC_annu_accumu(void)" (?MC_annu_accumu@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::paint(struct MODEL_LINK_INFO *,int,int,char *)" (?paint@class_model@@QAEXPAUMODEL_LINK_INFO@@HHPAD@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_daymicrobe(struct _iobuf *)" (?write_out_daymicrobe@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_daysp(struct _iobuf *)" (?write_out_daysp@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_daym(struct _iobuf *)" (?write_out_daym@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_dayg(struct _iobuf *)" (?write_out_dayg@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_dayn(struct _iobuf *)" (?write_out_dayn@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_dayc(struct _iobuf *)" (?write_out_dayc@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_dayw(struct _iobuf *,float)" (?write_out_dayw@class_model@@QAEHPAU_iobuf@@M@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::write_out_dayClim(struct _iobuf *,int,char *,int,float,float,float,float,float)" (?write_out_dayClim@class_model@@QAEXPAU_iobuf@@HPADHMMMMM@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_dayp(struct _iobuf *)" (?write_out_dayp@class_model@@QAEHPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: int __thiscall class_model::write_out_days(struct _iobuf *,float)" (?write_out_days@class_model@@QAEHPAU_iobuf@@M@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::cn_pools(float,float,float,float,float,float,float)" (?cn_pools@class_model@@QAEXMMMMMMM@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::ReDefineION(void)" (?ReDefineION@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::Substrate_leaching(int)" (?Substrate_leaching@class_model@@QAEXH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: float __thiscall class_model::CH4_paddy(int,int,float *,float *,int,int,float *,int,float *,float *,float *,int,float *,float *,float,float,int,float *,float *,float *,int *,float,fl
oat,float,float,float *,int,float,float *,float *,float *,float *,float *,float *,float *,int *,float *,float *,float,float *,float *,float,float *,float *,float *,float,float *,float *,int,float *,int,float,float *,float *,float *,float *,float *,f
loat,float *,int,float,float,float,float *)" (?CH4_paddy@class_model@@QAEMHHPAM0HH0H000H00MMH000PAHMMMM0HM0000000100M00M000M00H0HM00000M0HMMM0@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: float __thiscall class_model::CH4_peat(int,int,float *,float *,int,int,float *,int,float *,float *,float *,int,float *,float *,float *,float,int,float *,float *,float *,int *,float,f
loat,float,float,float *,int,float,float *,float *,float *,float *,float *,float *,float *,int *,float *,float *,float,float *,float *,float,float *)" (?CH4_peat@class_model@@QAEMHHPAM0HH0H000H000MH000PAHMMMM0HM0000000100M00M0@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::saturation_Eh(void)" (?saturation_Eh@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::annu_water_budget(float)" (?annu_water_budget@class_model@@QAEXM@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::dryland_ch4_oxidation(void)" (?dryland_ch4_oxidation@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::riceland_ch4_oxidation(void)" (?riceland_ch4_oxidation@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::dndc_decomposition(float *,float *,float *,float *,float *,float *,float *,float *,float *,float,float *,int,struct _iobuf *,struct _iobuf *,float *,floa
t *,int,int,float,float,float,float,float,float,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,int,float *,float *,float,int,float *,int,float *,int,int,float *,float *
,float *,float *,float *,float *,float *,float *,float,float *,float *,int *,float,float,float,float *,int,float,float *,float *,float *,float *,float *,float,float,float,float *,float *,float *,float *,float *,float *,float *,float *,float,float,fl
oat *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float,float *,float *,float *,float *,float *,float *,float *,int *,float *,float,float *,float *,float *,int,float *,float *,float
,float *,float *,float *,float *,float *,float *,float *,float *,float,float,int,int)" (?dndc_decomposition@class_model@@QAEXPAM00000000M0HPAU_iobuf@@100HHMMMMMM0000000000000000H00MH0H0HH00000000M00PAHMMM0HM00000MMM00000000MM000000000000000M00000002
0M000H00M00000000MMHH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::Mn_Fe_S_oxidation(void)" (?Mn_Fe_S_oxidation@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::N2O_balloon(int,float,float *,float *,int,int,int,float,float *,float *,float,float *,float *,int,int *,float *,int,double (* const)[180],float *,float,i
nt,float,float *,float *,int,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,float *,int,float *,float,int,float
*,float,float,float,int,int *,float *,float *,float *,float,int,int,float *,float *,float *,float *,float *,float *,float *,float,float *,float *,float *,float *,float *,float *,float *,float,float *,float *,float,int,int,float *,float *,float *,flo
at,int,int,struct _iobuf *,int,float,float *,float *,int,int,int,int,float,int,float *,float *,int)" (?N2O_balloon@class_model@@QAEXHMPAM0HHHM00M00HPAH0HQAY0LE@N0MHM00H000000000000000000000000H0MH0MMMH1000MHH0000000M0000000M00MHH000MHHPAU_iobuf@@HM0
0HHHHMH00H@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::NH4_HCO3(void)" (?NH4_HCO3@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::zero_DayFlux(void)" (?zero_DayFlux@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::daily_WT(struct _iobuf *)" (?daily_WT@class_model@@QAEXPAU_iobuf@@@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::crop_growth(int)" (?crop_growth@class_model@@QAEXH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: float __thiscall class_model::potential_et(int)" (?potential_et@class_model@@QAEMH@Z)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::soil_temperature(void)" (?soil_temperature@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::water_temperatue(void)" (?water_temperatue@class_model@@QAEXXZ)
Dndc_main.obj : error LNK2001: unresolved external symbol "public: void __thiscall class_model::init_soil_moisture(void)" (?in
...全文

相关推荐

error LNK1120和error lnk2001

在编程世界中,链接错误是开发过程中的常见问题,尤其是对于使用C++或类似编译型语言的开发者。

西门孤羽

error LNK2019: 无法解析的外部符号 问题的解决办法

LNK2019错误是Windows平台下使用Microsoft Visual Studio进行C++项目编译时常遇到的链接错误。

weixin_38697123

解决error LNK2001 无法解析的外部符号 int __cdecl sprintf(

在编程过程中,我们时常会遇到编译错误,其中"error LNK2001 无法解析的外部符号"是一个常见的链接器错误。这个错误通常发生在C++编程中,特别是当你试图使用一个未定义的函数或者变量时。

lj_70596

fatal error LNK1104: 无法打开文件“libc.lib”的解决方法

总的来说,解决“fatal error LNK1104: 无法打开文件“libc.lib””的关键在于理解错误的根源,即库文件与编译环境的兼容性问题,并采取适当的措施来调整项目设置或代码,以确保编译顺利进行

weixin_38659374

error LNK2005:已经在某一文件中定义/fatal error LNK1120: 无法解析的外部命令

假设我们有两个源代码文件 a.cpp 和 b.cpp,它们都包含了一个名为 func 的函数。在我们的主函数 main.cpp 中我们调用了这个 func 函数。这个错误表明,编译器在尝试链接 a.obj 和 b.obj 时发现两个文件都定义了名为 func 的函数。因此,它不知道使用哪一个函数,并提示我们使用了一个无法解析的外部命令。在实际编程中,我们应该注意保持良好的代码结构和编写规范,以避免这种错误的发生。在每个源文件中包含函数头的声明,告诉编译器该函数已经被定义过了,不需要重新定义。

技术驱动者
评论 12
收藏 已收藏
分享
返回顶部
诺森德5
C++ 语言 65,212 成员 250,513 内容