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

[二次开发及其理论] visual studio 2005下进行材料二次开发时碰到libc问题的解决方法总结

[复制链接]
发表于 2009-4-8 15:27:42 | 显示全部楼层 |阅读模式 来自 清华大学
本帖最后由 xieh05 于 2009-4-8 23:54 编辑

刚拿到相关文件,进行命令行编译时出现问题,由于本人很菜,google了一下午才解决。现总结如下:
======================
nmake的错误:

Intel(R) Fortran Compiler for 32-bit applications, Version 9.1    Build 20060323
Z Package ID: W_FC_P_9.1.024
Copyright (C) 1985-2006 Intel Corporation.  All rights reserved.

Fatal error cannot open "LIBC"
ifort: error: problem during multi-file optimization compilation (code 1)
NMAKE : fatal error U1077: 'ifort' : return code '0x1'


===============
原因:
http://blogs.msdn.com/brianjo/archive/2004/06/06/149854.aspx
MSDN Labs: What's New in Visual C++ 2005
The single-threaded CRT libraries, libc.lib, licd.lib, msvcrt.lib, and msvcrtd.lib, have been removed. Use the multi-threaded CRT libraries. The /MD, /ML, /MT, /LD (Use Run-Time Library) compiler flag is no longer supported. Non-locking versions of some functions have been added in cases where the performance difference between the multithreaded code and the single-threaded code is potentially significant.

===============
解决方法:
1、对于.net环境:
解决如下:项目->属性中->配置属性->链接器->输入->在忽略特定库中写入打不开的文件的名称LIBC.lib;

2、对于命令行编译方法:
在ifort后面的/link后面加参数:
/NODEFAULTLIB:libc.lib
或/NODEFAULTLIB:libc.lib
对于nmake来说,可以在makefile里面/link后加参数
(其实拿一个假的libc文件给它也可以)

===============
总的来说,visual studio 2005下对dyna进行二次开发的具体步骤如下:
1、安装Visual Studio 2005,其中包含Platform SDK
2、安装Visual Fortran 9.110.0
3、makefile文件中/link行后面加上/NODEFAULTLIB:libc.lib
4、新建批处理:
@call "C:\Program Files\Microsoft Visual Studio 8\VC\Bin\Vcvars32.bat"
@call "C:\Program Files\Intel\Compiler\Fortran\9.1\IA32\Bin\IFortVars.bat"
@del dyn21.obj
@del dyn21b.obj
nmake /f makefile>compile.log
5、修改f文件加入材料模型
6、运行批处理开始编译

另外请教一个问题,在vs环境下调试umat如何配置?

评分

1

查看全部评分

发表于 2009-7-6 22:39:09 | 显示全部楼层 来自 山西太原
Simdroid开发平台
本帖最后由 timothy1985 于 2009-7-6 22:51 编辑

楼主,你那个错误我倒是没遇到,但是出现了一下错误,该怎么解决啊?
D:\2\dyn21.F(1045): (col. 14) remark: LOOP WAS VECTORIZED.
D:\2\dyn21.F(1168): (col. 10) remark: LOOP WAS VECTORIZED.
D:\2\dyn21.F(1240): (col. 10) remark: PARTIAL LOOP WAS VECTORIZED.
D:\2\dyn21.F(1240): (col. 10) remark: PARTIAL LOOP WAS VECTORIZED.
D:\2\dyn21.F(1254): (col. 14) remark: LOOP WAS VECTORIZED.
D:\2\dyn21.F(1393): (col. 10) remark: LOOP WAS VECTORIZED.
        ifort -w -q -o ls971.exe dyn21.obj dyn21b.obj libdyna.lib libansys.lib libguide.lib shell32.lib user32.lib comctl32.l
ib comdlg32.lib -F:4000000 -link -force -nodefaultlib:msvcrt.lib
Intel(R) Visual Fortran Compiler Professional for applications running on IA-32, Version 11.0    Build 20081105 Package ID: w
_cprof_p_11.0.066
Copyright (C) 1985-2008 Intel Corporation.  All rights reserved.
libansys.lib(lm_new.obj):warning : locally defined symbol __imp__time imported
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.
-out:ls971.exe
-subsystem:console
-stack:4000000
-force
-nodefaultlib:msvcrt.lib
dyn21.obj
dyn21b.obj
libdyna.lib
libansys.lib
libguide.lib
shell32.lib
user32.lib
comctl32.lib
comdlg32.lib
libdyna.lib(dynm.o) : warning LNK4006: _MAIN__ 已在 dyn21.obj 中定义;已忽略第二个定义
libansys.lib(lm_new.obj) : warning LNK4217: 本地定义的符号 _time 在函数 _l_buf_21 中导入
ls971.exe : warning LNK4088: 因 /FORCE 选项生成了映像;映像可能不能运行





大家帮帮忙看看啊
回复 不支持

使用道具 举报

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

本版积分规则

Simapps系列直播

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

GMT+8, 2024-10-6 11:31 , Processed in 0.042861 second(s), 18 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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