博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenSees开发(一)windows 上编译opensees (使用vs2005)
阅读量:4079 次
发布时间:2019-05-25

本文共 2563 字,大约阅读时间需要 8 分钟。

先贴一段opensees的介绍

“OpenSees的全称是Open System for Earthquake Engineering Simulation (地震工程模拟的开放体系)。它是由美国(NSF)资助、西部大学联盟“太平洋地震工程研究中心”(Pacific Earthquake Engineering Research Center,简称PEER)主导、加州大学伯克利分校为主研发而成的、用于结构和岩土方面地震反应模拟的一个较为全面且不断发展的开放的程序软件体系。”

简单的说,它是一套开源的土木工程计算实现的C++类库和框架

下面介绍如何在windows平台利用vs2005编译opensees

1.下载源码:archive

2.下载tcl85

注意:1.请将安装目录从 c:/tcl 改为 c:\program files\tcl

2.如果你安装的是更高版本的activetcl,则可能需要更改头文件:

打开tcl.h,更改结构体的定义:

typedef struct Tcl_Interp {    char *result;		/* If the last command returned a string				 * result, this points to it. */    void (*freeProc) _ANSI_ARGS_((char *blockPtr));				/* Zero means the string result is statically				 * allocated. TCL_DYNAMIC means it was				 * allocated with ckalloc and should be freed				 * with ckfree. Other values give the address				 * of function to invoke to free the result.				 * Tcl_Eval must free it before executing next				 * command. */    int errorLine;		/* When TCL_ERROR is returned, this gives the				 * line number within the command where the				 * error occurred (1 if first line). */} Tcl_Interp;
安装完之后需要重新启动计算机

3.解压源码包,打开OpenSees2.3.0\Win32\opensees.sln,让vs自动转换就行

解决方案中有3个exe项目,openSees,openSeesTk,quickmain,其中quickmain为一个简单的实例,代码与OpenSees2.3.0\EXAMPLES\Example1一样,顺便说一下该代码有误,将在之后的分析中解决

将quickmain设为启动项目,编译,出现链接错误

正在链接...1>LINK : warning LNK4075: 忽略“/INCREMENTAL”(由于“/FORCE”规范)1>libm.lib(libm_error.obj) : error LNK2019: 无法解析的外部符号 _errno,该符号在函数 ___libm_error_support 中被引用1>libifcore.lib(for_nt_open_proc.obj) : error LNK2001: 无法解析的外部符号 _errno1>libifcore.lib(for_portlib.obj) : error LNK2001: 无法解析的外部符号 _errno1>libifcore.lib(for_init.obj) : error LNK2019: 无法解析的外部符号 __pxcptinfoptrs,该符号在函数 _GETEXCEPTIONPTRSQQ 中被引用1>.\..\..\bin/OpenSees.exe : fatal error LNK1120: 2 个无法解析的外部命令1>生成日志保存在“file://d:\Open Source\OpenSees2.3.0\Win32\obj\openSees\debug\BuildLog.htm”1>openSees - 5 个错误,1 个警告========== 生成: 0 已成功, 1 已失败, 23 最新, 0 已跳过 ==========

这需要将OpenSees2.3.0\Win32\VC2005errno.cpp加入工程中,不知道为什么原始的版本没有加,现在加入(注意按工程属性决定在*.cpp中是否添加预编译头文件),

再出现错误:

1>LINK : warning LNK4075: 忽略“/INCREMENTAL”(由于“/FORCE”规范)1>libifcore.lib(for_init.obj) : error LNK2019: 无法解析的外部符号 __pxcptinfoptrs,该符号在函数 _GETEXCEPTIONPTRSQQ 中被引用1>.\..\..\bin/OpenSees.exe : fatal error LNK1120: 1 个无法解析的外部命令

参考:

http://opensees.berkeley.edu/community/viewtopic.php?t=4624

http://opensees.berkeley.edu/community/viewtopic.php?t=5462

将链接输入库中的libifcore.lib改为libifcoremt.lib,ok,链接成功。

接下去,对于主工程quickmain,有众多项目依赖性,导致每次重新生成该项目会将其它lib项目重新编译,徒增编译时间(假定lib项目源码永远不改动的情况下),于是将项目依赖性全部清除,出现链接错误,根据排除法确定问题所在,在quickmain项目的链接依赖项中加入handler.lib 链接成功。

转载地址:http://nutni.baihongyu.com/

你可能感兴趣的文章
ubuntu 12.04 安装 GMA3650驱动
查看>>
新版本的linux如何生成xorg.conf
查看>>
xorg.conf的编写
查看>>
启用SELinux时遇到的问题
查看>>
virbr0 虚拟网卡卸载方法
查看>>
No devices detected. Fatal server error: no screens found
查看>>
新版本的linux如何生成xorg.conf
查看>>
virbr0 虚拟网卡卸载方法
查看>>
Centos 6.0_x86-64 终于成功安装官方显卡驱动
查看>>
Linux基础教程:CentOS卸载KDE桌面
查看>>
db sql montior
查看>>
read humor_campus
查看>>
IBM WebSphere Commerce Analyzer
查看>>
Unix + OS IBM Aix FTP / wu-ftp / proftp
查看>>
my read work
查看>>
db db2 base / instance database tablespace container
查看>>
hd disk / disk raid / disk io / iops / iostat / iowait / iotop / iometer
查看>>
project ASP.NET
查看>>
db db2_monitorTool IBM Rational Performace Tester
查看>>
OS + Unix Aix telnet
查看>>