我用UDF编程的时候总是出现如下错误,求大侠指点
#include<stdio.h>#include"udf.h"DIFINE_CG_MOTION(valve,dt,cg_vel,cg_omega,time,dtime)...
#include<stdio.h>
#include"udf.h"
DIFINE_CG_MOTION(valve,dt,cg_vel,cg_omega,time,dtime)
{
if(time<=0.5);
cg_vel[0]=-0.02;
else
cg_vel[0]=0.0;
}
Done.
已复制 1 个文件。
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2d\makefile")
已复制 1 个文件。
(chdir "libudf")()
(chdir "ntx86\2d")()
valve.c
..\..\src\valve.c(6) : error C2109: subscript requires array or pointer type
..\..\src\valve.c(6) : error C2106: '=' : left operand must be l-value
..\..\src\valve.c(7) : error C2181: illegal else without matching if
..\..\src\valve.c(8) : error C2109: subscript requires array or pointer type
..\..\src\valve.c(8) : error C2106: '=' : left operand must be l-value 展开
#include"udf.h"
DIFINE_CG_MOTION(valve,dt,cg_vel,cg_omega,time,dtime)
{
if(time<=0.5);
cg_vel[0]=-0.02;
else
cg_vel[0]=0.0;
}
Done.
已复制 1 个文件。
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\2d\makefile")
已复制 1 个文件。
(chdir "libudf")()
(chdir "ntx86\2d")()
valve.c
..\..\src\valve.c(6) : error C2109: subscript requires array or pointer type
..\..\src\valve.c(6) : error C2106: '=' : left operand must be l-value
..\..\src\valve.c(7) : error C2181: illegal else without matching if
..\..\src\valve.c(8) : error C2109: subscript requires array or pointer type
..\..\src\valve.c(8) : error C2106: '=' : left operand must be l-value 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询