找回密码
 注册
Simdroid-非首页
查看: 92|回复: 0

[二次开发] 关于LINK : fatal error LNK1104 **.lib 问题的一点看法

[复制链接]
发表于 2012-4-16 17:14:18 | 显示全部楼层 |阅读模式 来自 河南郑州
今天在测试一个小的用户程序的时候突然 abaqus 提示错误。利用 absqus job=** user =**.for int 选项进行查看的时候提示 LINK : fatal error LNK1104 无法打开文件“OLDNAMES.LIB”,这么一个错误。打开 log 文件查看具体内容是:

Abaqus JOB exa_hydfracture
Abaqus 6.11-1
Begin Compiling Abaqus/Standard User Subroutines
4/16/2012 3:46:00 PM
End Compiling Abaqus/Standard User Subroutines
4/16/2012 3:46:01 PM
Begin Linking Abaqus/Standard User Subroutines
4/16/2012 3:46:01 PM
LINK : fatal error LNK1104: 无法打开文件“OLDNAMES.LIB”
Abaqus Error: Problem during linking - Abaqus/Standard User Subroutines.
  This error may be due to a mismatch in the Abaqus user subroutine arguments.
  These arguments sometimes change from release to release, so user subroutines
  used with a previous release of Abaqus may need to be adjusted.
Abaqus/Analysis exited with errors





当时很纳闷,因为以前用的好好的,现在不能用了。我就在想到底哪里出了问题。

由于昨天刚重装了系统,故而我怀疑是aba 与Fortran 没有关联好。我用verifiaction 测试了下abaqus 的设置。得到的是如下结果。

Abaqus Product Install Verification...

Mon Apr 16 15:50:50 2012

Running system requirement checks.

Requirement:    Windows Server 2003, Windows XP, Windows Vista, or Windows 7
Product:        All Abaqus Products
Status:         Pass - Found Windows 7 Ultimate Service Pack 1 (Build 7601)
                (x86).

Requirement:    Microsoft Visual C++ 9.0 (2008), or 10.0 (2010)
Product:        Abaqus make utility with C++
Status:         Fail - Unable to locate or determine the version of a C++
                compiler on this system.  If Microsoft Visual C++ 8.0 (.NET
                2005) is installed on this system, please load the
                vcvars32.bat file before running Abaqus.

Requirement:    Intel Fortran Compiler 10.1 or 11.1
Product:        Abaqus make utility with Fortran and Abaqus with user
                subroutines
Status:         Pass - Found Intel Fortran Compiler 11.1 Build 20101201
                Package ID w_cprof_p_11.1.072.

Requirement:    HP-MPI 01.01.00.00
Product:        Abaqus analyses using MPI-based parallelization and
                Abaqus/CFD
Status:         Pass - Found HP-MPI 01.01.00.00.

Requirement:    Internet Explorer 6.0 or 7.0 or 8.0, Firefox 2.0 or 3.0 or
                3.5, or greater
Product:        Abaqus Documentation
Status:         Pass - Found Firefox 11.0.0.0

Making d:\Temp\verify. All verification files will reside in this directory.

-----------------------------------------------------------------------------
Abaqus/Standard


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Standard with user subroutines


         ...ERROR

            Abaqus did not complete successfully.

            Please see std_user.log for details.

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit (single precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit (double precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit with user subroutines (single precision)


         ...ERROR

            Abaqus did not complete successfully.

            Please see xpl_user_sp.log for details.

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit with user subroutines (double precision)


         ...ERROR

            Abaqus did not complete successfully.

            Please see xpl_user_dp.log for details.

         Continuing...

-----------------------------------------------------------------------------
以下省略。。。

通过对比,发现,abaqus 检测到了我安装了Fortran。但是却不能顺利编译。
所以我又重新打开intel visual Fortran +vs 2008 进行测试。用简单的代码测试结果如下:
测试代码:


!  Console1.f90
!
!  FUNCTIONS:
!  Console1 - Entry point of console application.
!

!****************************************************************************
!
!  PROGRAM: Console1
!
!  PURPOSE:  Entry point for the console application.
!
!****************************************************************************

    program Console1

    implicit none

    ! Variables

    ! Body of Console1
    print *, 'Hello World!!'

    end program Console1


编译结果:


1>------ 已启动生成: 项目: Console1, 配置: Debug Win32 ------
1>Compiling with Intel(R) Visual Fortran 11.1.072 [IA-32]...
1>Console1.f90
1>Linking : LINK : fatal error LNK1104 无法打开文件“LIBCMTD.LIB”
1>Embedding manifest...
1>
1>Build log written to  "file://C:\Users\lshkai\Documents\Visual Studio 2008\Projects\Console1\Console1\Debug\BuildLog.htm"
1>Console1 - 1 error(s), 0 warning(s)
========== 生成: 成功 0 个,失败1 个,最新 0 个,跳过 0 个 ==========

从上面可以看到是最简单的测试代码,却不能顺利执行。我得到的信息是无法打开 **.lib ,也就是说不是abaqus 的问题,而是Fortran本身没有安装好。
分析原因,由于这个Fortran编译器用过很多次,不应该是编译器损坏。那就只有一个问题,即 ,我的vs 2008 选项的问题。回忆了一下我这次安装的过程,在安装的过程中为了节省硬盘空间,在vs安装的时候 c ++选项里进行了精简。当时的选择内容是如下图所示:



这个时候测试会是出问题的。所以我想很有可能是c++没有安装成功,故,重新打开vs安装程序,进行增加内容,增加下图所示内容:





这个时候再进行上面代码测试的时候已经变成了如下图所示了:



而这个时候 verification 内容变成了:
Abaqus Product Install Verification...

Mon Apr 16 17:03:11 2012

Running system requirement checks.

Requirement:    Windows Server 2003, Windows XP, Windows Vista, or Windows 7
Product:        All Abaqus Products
Status:         Pass - Found Windows 7 Ultimate Service Pack 1 (Build 7601)
                (x86).

Requirement:    Microsoft Visual C++ 9.0 (2008), or 10.0 (2010)
Product:        Abaqus make utility with C++
Status:         Fail - Unable to locate or determine the version of a C++
                compiler on this system.  If Microsoft Visual C++ 8.0 (.NET
                2005) is installed on this system, please load the
                vcvars32.bat file before running Abaqus.

Requirement:    Intel Fortran Compiler 10.1 or 11.1
Product:        Abaqus make utility with Fortran and Abaqus with user
                subroutines
Status:         Pass - Found Intel Fortran Compiler 11.1 Build 20101201
                Package ID w_cprof_p_11.1.072.

Requirement:    HP-MPI 01.01.00.00
Product:        Abaqus analyses using MPI-based parallelization and
                Abaqus/CFD
Status:         Pass - Found HP-MPI 01.01.00.00.

Requirement:    Internet Explorer 6.0 or 7.0 or 8.0, Firefox 2.0 or 3.0 or
                3.5, or greater
Product:        Abaqus Documentation
Status:         Pass - Found Firefox 11.0.0.0

Found d:\Temp\verify.  All verification files will reside in this directory.

Old job files exist.  They will be moved to verifyOLD.

-----------------------------------------------------------------------------
Abaqus/Standard


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Standard with user subroutines


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit (single precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit (double precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit with user subroutines (single precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
Abaqus/Explicit with user subroutines (double precision)


         ...PASS

         Continuing...

-----------------------------------------------------------------------------
下略。。。
重新测试了下 子程序:计算过程如下:




哈哈,大功告成!!


综上:如果出现这个link 1104 问题的时候,很有可能是你的Fortran没有安装好。推荐大家采用vs 默认选项安装。这个一定没问题。如果精简过的话,请自行测试应该删减哪些内容。

一点小经验体会,发来让大家一起看看。说不准**者迷。。

祝好。。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-10-2 20:26 , Processed in 0.027299 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表