24小时热门版块排行榜    

查看: 1897  |  回复: 1

damin83730

银虫 (小有名气)

[求助] udf导入失败,报错:无法解析的外部符号,有没有人遇到过这种情况的,该怎么解决?

Copied e:\hovering fruit insect wing\wingx\robotfly/E:\hovering fruit insect wing\wingx\robotfly\robofly.c to robofly\src
udf_names.c file in 2d is upto date.
(system "copy "D:\Program Files\ANSYS Inc\v145\fluent"\fluent14.5.0\src\makefile_nt.udf "robofly\win64\2d\makefile" "
已复制         1 个文件。
(chdir "robofly"()
(chdir "win64\2d"()
# Linking libudf.dll because of makefile user_nt.udf udf_names.obj robofly.obj
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.
正在创建库 libudf.lib 和对象 libudf.exp
robofly.obj : error LNK2019: 无法解析的外部符号 cos,该符号在函数 harmonic 中被引用
robofly.obj : error LNK2019: 无法解析的外部符号 sin,该符号在函数 harmonic 中被引用
robofly.obj : error LNK2001: 无法解析的外部符号 _fltused
LINK : error LNK2001: 无法解析的外部符号 _DllMainCRTStartup
libudf.dll : fatal error LNK1120: 4 个无法解析的外部命令

udf文件如下:
#include "udf.h"
#include"math.h"
#define PAI 3.14159265358979323846
#define T 40
#define N 15
#define ts 0.14
#define tr 0.3
#define As (70/180*PAI)
#define Aa (55/180*PAI)
#define Ws (As/(2*ts*T/PAI+0.5*T-ts*T))
#define Wa (Aa/0.5/tr/T)
#define Rg 0.1624584
static int n=0;
DEFINE_CG_MOTION(harmonic,dt,vel,omega,time,dtime)
{  real t;
   t=time/T-n+0.5;
   if (n<=N)
   {
              if ((t>=0)&&(t<=0.5*ts))                  vel[0]=Rg*Ws*sin(t*PAI/ts);
         else if ((t>0.5*ts)&&(t<(0.5-0.5*ts)))         vel[0]=Rg*Ws;
         else if ((t>=(0.5-0.5*ts))&&(t<=(0.5+0.5*ts))) vel[0]=Rg*Ws*sin(PAI/2/ts-PAI/ts*t);
         else if ((t>(0.5+0.5*ts))&&(t<(1-0.5*ts)))     vel[0]=-Ws*Rg;
         else if ((t>=(1-0.5*ts))&&(t<=1))              vel[0]=Rg*Ws*sin(PAI/ts*t-PAI*ts);

              if ((t>=0)&&(t<=0.5*tr))                  omega[2]=-Wa+Wa*cos(t/tr*2*PAI+PAI);
         else if ((t>0.5*tr)&&(t<(0.5-0.5*tr)))         omega[2]=0;
         else if ((t>=(0.5-0.5*tr))&&(t<=(0.5+0.5*tr))) omega[2]=Wa-Wa*cos(2*PAI/tr*t-PAI/tr+PAI);
         else if ((t>(0.5+0.5*tr))&&(t<(1-0.5*tr)))     omega[2]=0;
         else if ((t>=(1-0.5*tr))&&(t<=1))              omega[2]=-Wa+Wa*cos(2*PAI/tr*t-2*PAI/tr+PAI);
    }
    if (t==1.0) n+=1;
}

[ Last edited by damin83730 on 2013-6-3 at 19:21 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sh073

木虫 (正式写手)

你好,请问这个问题解决了么?
2楼2013-10-31 23:22:33
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 damin83730 的主题更新
信息提示
请填处理意见