Error LNK1181 while building OpenSees by Visual Studio2017

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Error LNK1181 while building OpenSees by Visual Studio2017

Post by LiuYanyan » Wed Nov 21, 2018 5:39 am

Dear All
I am getting the following error when I try to build the solution (OpenSees.sln for Win32) of the source code.
I obtained the source code from Github at 2018/11/16.
OpenSees release_2.5.0
tcl/tk x64 8.5.18

Error: LNK1181 cannot open input file 'ifconsol.lib'

----------------------------------------------------------------------------------------------------
>------ Build started: Project: OpenSees, Configuration: Debug x64 ------
>tclAppInit.cpp
>tclMain.cpp
>VC2005errno.cpp
>Generating Code...
>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
>LINK : fatal error LNK1181: cannot open input file 'ifconsol.lib'
>Done building project "OpenSees.vcxproj" -- FAILED.
-----------------------------------------------------------------------------------------------------

My OS is windows 7 (64bit), so I tried to compile using OpenSees.sln for Win64.
The same error occurred.

Can anyone help me out to identify what goes wrong and fix it?

LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Re: Error LNK2001 while building OpenSees by Visual Studio20

Post by LiuYanyan » Thu Nov 22, 2018 12:42 am

LiuYanyan wrote:
> Dear All
> I am getting the following error when I try to build the solution (OpenSees.sln for
> Win32) of the source code.
> I obtained the source code from Github at 2018/11/16.
> OpenSees release_2.5.0
> tcl/tk x64 8.5.18
>
> Error: LNK1181 cannot open input file 'ifconsol.lib'
>
> ----------------------------------------------------------------------------------------------------
> >------ Build started: Project: OpenSees, Configuration: Debug x64 ------
> >tclAppInit.cpp
> >tclMain.cpp
> >VC2005errno.cpp
> >Generating Code...
> >LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
> >LINK : fatal error LNK1181: cannot open input file 'ifconsol.lib'
> >Done building project "OpenSees.vcxproj" -- FAILED.
> -----------------------------------------------------------------------------------------------------
>
> My OS is windows 7 (64bit), so I tried to compile using OpenSees.sln for Win64.
> The same error occurred.
>
> Can anyone help me out to identify what goes wrong and fix it?


I dropped 'ifconsol.lib' and 'ifcoremt.lib' into Win32/lib and fixed this problem but more errors came out.
They are LNK 2001 and LNK 2019.
I past part of the description here.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
domain.lib(TclSeriesCommand.obj) : error LNK2001: unresolved external symbol __imp__Tcl_SplitList
domain.lib(TclSeriesIntegratorCommand.obj) : error LNK2001: unresolved external symbol __imp__Tcl_SplitList
element.lib(TclForceBeamColumnCommand.obj) : error LNK2001: unresolved external symbol __imp__Tcl_SplitList
element.lib(TclForceBeamColumnCommand.obj) : error LNK2019: unresolved external symbol __imp__Tcl_Merge referenced in function "int __cdecl TclModelBuilder_addForceBeamColumn(void *,struct Tcl_Interp *,int,char const * *,class Domain *,class TclModelBuilder *)" (?TclModelBuilder_addForceBeamColumn@@YAHPAXPAUTcl_Interp@@HPAPBDPAVDomain@@PAVTclModelBuilder@@@Z)
25>element.lib(TclForceBeamColumnCommand.obj) : error LNK2019: unresolved external symbol "public: __thiscall DispBeamColumnNL2d::DispBeamColumnNL2d(int,int,int,int,class SectionForceDeformation * *,class BeamIntegration &,class CrdTransf &,double)" (??0DispBeamColumnNL2d@@QAE@HHHHPAPAVSectionForceDeformation@@AAVBeamIntegration@@AAVCrdTransf@@N@Z) referenced in function "int __cdecl TclModelBuilder_addForceBeamColumn(void *,struct Tcl_Interp *,int,char const * *,class Domain *,class TclModelBuilder *)" (?TclModelBuilder_addForceBeamColumn@@YAHPAXPAUTcl_Interp@@HPAPBDPAVDomain@@PAVTclModelBuilder@@@Z)
optimization.lib(TclOptimizationBuilder.obj) : error LNK2019: unresolved external symbol __imp__Tcl_GetVar2 referenced in function "int __cdecl TclOptimizationModelBuilder_addDesignVariable(void *,struct Tcl_Interp *,int,char * *)" (?TclOptimizationModelBuilder_addDesignVariable@@YAHPAXPAUTcl_Interp@@HPAPAD@Z)
optimization.lib(DesignVariable.obj) : error LNK2001: unresolved external symbol __imp__Tcl_GetVar2
optimization.lib(ConstraintFunction.obj) : error LNK2001: unresolved external symbol __imp__Tcl_GetVar2
optimization.lib(ObjectiveFunction.obj) : error LNK2001: unresolved external symbol __imp__Tcl_GetVar2
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Does anyone have an idea to fix that?

ghorbanpour
Posts: 1
Joined: Thu Nov 22, 2018 4:59 am
Contact:

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by ghorbanpour » Thu Nov 22, 2018 5:02 am

hi LiuYanyan, thanks for sharing.....

LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by LiuYanyan » Fri Nov 23, 2018 5:33 am

Finally, I succeed.
Now I summarize my solution.

About error LNK 2001:
I try to compile the OS2.5.0 (Win32) on VS2017 32bit.
So I uninstalled Tcl and reinstalled it into Program Files (x86).

About error LNK 2019:
The following four files are missing. Add these files to the appropriate project and build solution.
DispBeamColumnNL2d.h DispBeamColumnNL2d.cpp
Beam3dPartialUniformLoad.h Beam3dPartialUniformLoad.cpp

Wish my experience is helpful.

yimingjia
Posts: 3
Joined: Sat Jun 04, 2016 11:45 am
Location: Northeastern University

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by yimingjia » Wed Dec 05, 2018 11:18 am

Hi Yanyan,

Where did you find 'ifconsol.lib' and 'ifcoremt.lib'?
So far I have the same issue as you had before.

Thanks,
Yiming

LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by LiuYanyan » Wed Dec 05, 2018 7:21 pm

yimingjia wrote:
> Hi Yanyan,
>
> Where did you find 'ifconsol.lib' and 'ifcoremt.lib'?
> So far I have the same issue as you had before.
>
> Thanks,
> Yiming

Hi Yiming
'ifconsol.lib' and 'ifcoremt.lib' are Fortran Library files.
Because I have installed Inter Visual Fortran before, Fortran Library already exists on my computer.
Firstly, I recommend you search these files on your computer.
If there are no such files on your computer, you can consider installing or I can send you these files.

JackWang
Posts: 3
Joined: Mon Apr 10, 2017 3:36 pm
Location: Harbin Institute of Technology

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by JackWang » Fri Dec 14, 2018 5:39 am

Hello Yanyan
I also encountered the error ''fatal error LNK1181: cannot open input file 'ifconsol.lib'''. My configuration is Windows 10 (64bit), VS2017 Community (64bit). Could you share which version of Inter Visual Fortran should I install?
Many thanks!

LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by LiuYanyan » Fri Dec 14, 2018 7:28 am

JackWang wrote:
> Hello Yanyan
> I also encountered the error ''fatal error LNK1181: cannot open input file
> 'ifconsol.lib'''. My configuration is Windows 10 (64bit), VS2017 Community
> (64bit). Could you share which version of Inter Visual Fortran should I
> install?
> Many thanks!

Hello JackWang

I installed Intel® Parallel Studio XE Cluster Edition.
There are other options.
As long as you choose the right application(64bit), it will work fine.

JackWang
Posts: 3
Joined: Mon Apr 10, 2017 3:36 pm
Location: Harbin Institute of Technology

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by JackWang » Mon Dec 17, 2018 12:40 am

Hi Yanyan,
Thanks for your kind instruction. I have fixed up the error ''fatal error LNK1181: cannot open input file 'ifconsol.lib'' by installing Intel Parallel Studio XE 2018 (update 3). Could you share which version of Visual Studio you are using to build OpenSees2.5.0(64bit) source code?
Now, I am using the Visual Studio 2017 Community (64bit). There is a prompt when I open the OpenSees.sln at the first time. The prompt is "The following projects use an earlier version of the Visual C++ platform toolset. You can upgrade your projects to target the latest Microsoft toolset. You can also select the target Windows SDK version from those installed on your machine." Then, the following errors come up when building the source code:
16>MaterialResponse.cpp
12>Done building project "material.vcxproj" -- FAILED.
---------------------------------------------------------------------------------------------------------------
25>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
25>LINK : fatal error LNK1181: cannot open input file 'DoddRestrepo.lib'
25>Done building project "OpenSees.vcxproj" -- FAILED.
---------------------------------------------------------------------------------------------------------------
26>d:\windows kits\10\include\10.0.17763.0\um\winnt.h(20580): error C2059: syntax error: 'constant'
26>d:\windows kits\10\include\10.0.17763.0\um\winnt.h(20580): error C2238: unexpected token(s) preceding ';'
26>d:\windows kits\10\include\10.0.17763.0\um\processthreadsapi.h(1032): error C2059: syntax error: 'constant'
26>d:\windows kits\10\include\10.0.17763.0\um\processthreadsapi.h(1032): error C2238: unexpected token(s) preceding ';'
26>d:\windows kits\10\include\10.0.17763.0\um\processthreadsapi.h(1151): error C2059: syntax error: 'constant'
26>d:\windows kits\10\include\10.0.17763.0\um\processthreadsapi.h(1151): error C2238: unexpected token(s) preceding ';'
26>d:\osmaterialdev\opensees250\src\tcl\winmain.cpp(286): warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using vsprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
26>d:\windows kits\10\include\10.0.17763.0\ucrt\stdio.h(1469): note: see declaration of 'vsprintf'
26>Generating Code...
26>Done building project "OpenSeesTk.vcxproj" -- FAILED.
========== Build: 23 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========

Whether these errors are related to the version of Visual Studio? Should I use the Visual Studio 2010, which the OpenSees 2.5.0 source code used?
Many thanks!

mneuner
Posts: 1
Joined: Thu Sep 27, 2018 10:55 pm
Location: Innsbruck University

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by mneuner » Mon Dec 17, 2018 12:11 pm

I had the same errors for release 2.5:

- copied DoddRestrepo.lib (and fedeas.lib) from the current release ( https://github.com/OpenSees/OpenSees/tr ... ib/release) into Win64/release/lib.
- the 'winnt.h' errors are fixed by adding #include <windows.h> on top of tkMain.cpp and winMain.cpp

LiuYanyan
Posts: 7
Joined: Thu Nov 08, 2018 9:39 pm
Location: Kyoto Univeristy

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by LiuYanyan » Mon Dec 17, 2018 7:04 pm

Hello JackWang
I use visual studio 2017 and I haven't encountered these problems you mentioned above.
Maybe you can try the following method.


mneuner wrote:
> I had the same errors for release 2.5:
>
> - copied DoddRestrepo.lib (and fedeas.lib) from the current release (
> https://github.com/OpenSees/OpenSees/tr ... ib/release) into
> Win64/release/lib.
> - the 'winnt.h' errors are fixed by adding #include <windows.h> on top of
> tkMain.cpp and winMain.cpp

yimingjia
Posts: 3
Joined: Sat Jun 04, 2016 11:45 am
Location: Northeastern University

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by yimingjia » Mon Dec 17, 2018 9:38 pm

LiuYanyan wrote:
> yimingjia wrote:
> > Hi Yanyan,
> >
> > Where did you find 'ifconsol.lib' and 'ifcoremt.lib'?
> > So far I have the same issue as you had before.
> >
> > Thanks,
> > Yiming
>
> Hi Yiming
> 'ifconsol.lib' and 'ifcoremt.lib' are Fortran Library files.
> Because I have installed Inter Visual Fortran before, Fortran Library already exists
> on my computer.
> Firstly, I recommend you search these files on your computer.
> If there are no such files on your computer, you can consider installing or I can
> send you these files.

Hi Yanyan,

Thanks. I fixed this issue by installing Intel Parallel studio 2017.
Before, I installed Intel Parallel studio 2019, which has an integration issue for Intel Parallel studio 2019 with Visual Studio 2017.

Thanks,
Yiming

JackWang
Posts: 3
Joined: Mon Apr 10, 2017 3:36 pm
Location: Harbin Institute of Technology

Re: Error LNK1181 while building OpenSees by Visual Studio20

Post by JackWang » Tue Dec 18, 2018 2:37 am

LiuYanyan wrote:
> Hello JackWang
> I use visual studio 2017 and I haven't encountered these problems you mentioned
> above.
> Maybe you can try the following method.
>
>
> mneuner wrote:
> > I had the same errors for release 2.5:
> >
> > - copied DoddRestrepo.lib (and fedeas.lib) from the current release (
> > https://github.com/OpenSees/OpenSees/tr ... ib/release) into
> > Win64/release/lib.
> > - the 'winnt.h' errors are fixed by adding #include <windows.h> on top
> of
> > tkMain.cpp and winMain.cpp

Hi,mneuner and Yanyan, thanks to both of you!I will have a try.

Post Reply