error LNK1120 and LNK2001 while building
Moderators: silvia, selimgunay, Moderators
error LNK1120 and LNK2001 while building
Dear FMK,
I downlode the latest source code on svn last week and try to build the OpenSees.exe on my x64 win10. I open the ../win64/OpenSees.sln with VS2015. The OpenSees project is set as the StartUp project. The tcl/include and tcl/lib is added to the VC++ Directories. The following error occurred while building OpenSees project.
25> Generating Code...
25>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
25> umfpackC.lib(SuiteSparse_config.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
25>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
25> Creating library .\..\..\bin\OpenSees.lib and object .\..\..\bin\OpenSees.exp
25>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
25>LIBCMTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
25>actor.lib(FEM_ObjectBrokerAllClasses.obj) : error LNK2001: unresolved external symbol "public: __cdecl DataFileStreamAdd::DataFileStreamAdd(int)" (??0DataFileStreamAdd@@QEAA@H@Z)
25>recorder.lib(TclRecorderCommands.obj) : error LNK2001: unresolved external symbol "public: __cdecl DataFileStreamAdd::DataFileStreamAdd(char const *,enum openMode,int,int,bool,int,bool)" (??0DataFileStreamAdd@@QEAA@PEBDW4openMode@@HH_NH2@Z)
25>libifcoremt.lib(for_diags_intel.obj) : error LNK2001: unresolved external symbol vsprintf
25>libirc.lib(irc_msg_support.obj) : error LNK2001: unresolved external symbol vsprintf
25>libifcoremt.lib(for_diags_intel.obj) : error LNK2001: unresolved external symbol __iob_func
25>libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol __iob_func
25>libm.lib(libm_error.obj) : error LNK2001: unresolved external symbol __iob_func
25>libm.lib(libm_error.obj) : error LNK2001: unresolved external symbol _snprintf
25>libirc.lib(tbk_display.obj) : error LNK2001: unresolved external symbol _snprintf
25>material.lib(TclModelBuilderNDMaterialCommand.obj) : error LNK2001: unresolved external symbol "public: __cdecl CapPlasticity::CapPlasticity(int,double,double,double,double,double,double,double,double,double,double,double,double,int,double)" (??0CapPlasticity@@QEAA@HNNNNNNNNNNNNHN@Z)
25>.\..\..\bin\OpenSees.exe : fatal error LNK1120: 6 unresolved externals
Could you help me with that? Thank you very much!
I downlode the latest source code on svn last week and try to build the OpenSees.exe on my x64 win10. I open the ../win64/OpenSees.sln with VS2015. The OpenSees project is set as the StartUp project. The tcl/include and tcl/lib is added to the VC++ Directories. The following error occurred while building OpenSees project.
25> Generating Code...
25>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
25> umfpackC.lib(SuiteSparse_config.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
25>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
25> Creating library .\..\..\bin\OpenSees.lib and object .\..\..\bin\OpenSees.exp
25>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
25>LIBCMTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
25>actor.lib(FEM_ObjectBrokerAllClasses.obj) : error LNK2001: unresolved external symbol "public: __cdecl DataFileStreamAdd::DataFileStreamAdd(int)" (??0DataFileStreamAdd@@QEAA@H@Z)
25>recorder.lib(TclRecorderCommands.obj) : error LNK2001: unresolved external symbol "public: __cdecl DataFileStreamAdd::DataFileStreamAdd(char const *,enum openMode,int,int,bool,int,bool)" (??0DataFileStreamAdd@@QEAA@PEBDW4openMode@@HH_NH2@Z)
25>libifcoremt.lib(for_diags_intel.obj) : error LNK2001: unresolved external symbol vsprintf
25>libirc.lib(irc_msg_support.obj) : error LNK2001: unresolved external symbol vsprintf
25>libifcoremt.lib(for_diags_intel.obj) : error LNK2001: unresolved external symbol __iob_func
25>libifcoremt.lib(for_nt_open_proc.obj) : error LNK2001: unresolved external symbol __iob_func
25>libm.lib(libm_error.obj) : error LNK2001: unresolved external symbol __iob_func
25>libm.lib(libm_error.obj) : error LNK2001: unresolved external symbol _snprintf
25>libirc.lib(tbk_display.obj) : error LNK2001: unresolved external symbol _snprintf
25>material.lib(TclModelBuilderNDMaterialCommand.obj) : error LNK2001: unresolved external symbol "public: __cdecl CapPlasticity::CapPlasticity(int,double,double,double,double,double,double,double,double,double,double,double,double,int,double)" (??0CapPlasticity@@QEAA@HNNNNNNNNNNNNHN@Z)
25>.\..\..\bin\OpenSees.exe : fatal error LNK1120: 6 unresolved externals
Could you help me with that? Thank you very much!
Re: error LNK1120 and LNK2001 while building
the missing DataFileStreamAdd and CapPlasticity you need to add the .cpp files to the projects or co a version that corresponds to last release
the others i am not sure about/
the others i am not sure about/
Re: error LNK1120 and LNK2001 while building
@fmk Thank you very much for your reply. If I want to modify some of the existing material in OpenSees to make it a useable .dll file , which parts of the .cpp and .h file should I modify. For now I change the name of the material and some mat_tag define, but it doesn't work even for some simple material. I wonder if I am doing it wrong. Since the build didn't work well, I hope I could use the .dll method instead. Thank you for your time.
Re: error LNK1120 and LNK2001 while building
i have not tried the dll approach with VS2015 so I don't know .. do the basic examples provided in the DEVELOPER directory work.
Re: error LNK1120 and LNK2001 while building
@fmk, thank you for your reply.The example in the DEVELOPER directory works well. So I think VS2015 may be the same as VS2010. The ElasticPPcpp.dll was created and could be used by OpenSees. As for a test, follow the same procedures I changed the Concrete02.cpp .h to Concrete22.cpp .h(just change the name and related MAT_TAG). The Concrete22.dll is created, but the OpensSees could not use it with a warning " Could not creat uniaxialMaterial Concrete22" . So I think maybe the change of just name and MAT_TAG is not enough. What's more should I do to modify the existing material .cpp and .h if I want to make it a dll approach. Thank you very much for your time!
Re: error LNK1120 and LNK2001 while building
do you complie successfully in vs2015?
in vs2017, the same error come out as yours.
in vs2017, the same error come out as yours.
Re: error LNK1120 and LNK2001 while building
did you change the OPS_ procedure name and the name of the XXX.dll .. it looks for a dll of a specific name (the ele command) and an OPS_XXX procedure withinn that .dll .. if either is not found, or the dll was compiled with DEVELOPER code that is different from th .exe_ that is when you get the error.
Re: error LNK1120 and LNK2001 while building
I have complie successfully in vs2017,when i setup intel fortran 2018, and the errors didn't come out.