找回密码
 注册
查看: 3312|回复: 2

[求助]一个奇怪的编译错误

[复制链接]
发表于 2008-5-29 17:55:00 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

x
我在用FLUENT使用VC++6.0编译器编译一个UDF时出现了一大堆的错误,细细看来,似乎是编译过程中不认识cell_t,Thread和real。这怎么可能呢?这些不是FLUENT里特有的定义类型吗?难道编译和FLUENT脱节了,编译器还是不认识这些定义类型?这个问题该如何解决呢?高手们请帮帮忙啊!
源程序前面部分:
#include "udf.h"
#define PI M_PI
#define TINY 1.0e-37
extern int offset,num;
extern float *diamAry;
extern  real rhoPartikel,molDiam ;
static real dmaxarg1,dmaxarg2;
#define RMAX(a,b) (dmaxarg1=(a),dmaxarg2=(b),(dmaxarg1) > (dmaxarg2) ?\
        (dmaxarg1) : (dmaxarg2))
DEFINE_ON_DEMAND(Auswertung)
{
    cell_t c;
    Thread *t;
    face_t f;
    Domain *d;
    d=Get_Domain(1);
    cell_t  c0=-1;
    Thread *t0=NULL;

    real lossesImp,vPx,vPy,vPz,d_p,masse,konz,NV_VEC(A);
    real lossesDiff,friction,B1,B2,B3,kB,diffKoeff,press,T0,nu,p_operating,C;
    real freieWegl,NV_VEC(geschwPartikel),rhoGas,lossesDiffSum,lossesImpSum;
    int  dimension,k,equation,i;
    equation=EQ_UDS+offset;
    dimension=ND_ND;  
等等,后面不用看了,到这里已经错的不行了
编译信息:
Deleted old test-2\ntx86\2ddp\libudf.dll
        1 Datei(en) kopiert.
        1 Datei(en) kopiert.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf test-2\ntx86\2ddp\makefile")
        1 Datei(en) kopiert.
(chdir "test-2")()
(chdir "ntx86\2ddp")()
auswertungOnDemand.c
..\..\src\auswertungOnDemand.c(21) : error C2275: ';cell_t'; : illegal use of this type as an expression
        C:\Fluent.Inc\fluent6.3.26\src\mem.h(173) : see declaration of ';cell_t';
..\..\src\auswertungOnDemand.c(21) : error C2146: syntax error : missing ';;'; before identifier ';c0';
..\..\src\auswertungOnDemand.c(21) : error C2065: ';c0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(22) : error C2275: ';Thread'; : illegal use of this type as an expression
        C:\Fluent.Inc\fluent6.3.26\src\mem.h(653) : see declaration of ';Thread';
..\..\src\auswertungOnDemand.c(22) : error C2065: ';t0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2275: ';real'; : illegal use of this type as an expression
        C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(24) : error C2146: syntax error : missing ';;'; before identifier ';lossesImp';
..\..\src\auswertungOnDemand.c(24) : error C2065: ';lossesImp'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPx'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPy'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';vPz'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';d_p'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';masse'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';konz'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2065: ';A'; : undeclared identifier
..\..\src\auswertungOnDemand.c(24) : error C2109: subscript requires array or pointer type
..\..\src\auswertungOnDemand.c(25) : error C2275: ';real'; : illegal use of this type as an expression
        C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(25) : error C2146: syntax error : missing ';;'; before identifier ';lossesDiff';
..\..\src\auswertungOnDemand.c(25) : error C2065: ';lossesDiff'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';friction'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B1'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B2'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';B3'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';kB'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';diffKoeff'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';press'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';T0'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';nu'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';p_operating'; : undeclared identifier
..\..\src\auswertungOnDemand.c(25) : error C2065: ';C'; : undeclared identifier
..\..\src\auswertungOnDemand.c(26) : error C2275: ';real'; : illegal use of this type as an expression
        C:\Fluent.Inc\fluent6.3.26\src\global.h(150) : see declaration of ';real';
..\..\src\auswertungOnDemand.c(26) : error C2146: syntax error : missing ';;'; before identifier ';freieWegl';
..\..\src\auswertungOnDemand.c(26) : error C2065: ';freieWegl'; : undeclared identifier
..\..\src\auswertungOnDemand.c(26) : error C2065: ';geschwPartikel'; : undeclared identifier
等等,后面不用看了,前面已经错的不行了
发表于 2008-5-30 10:03:05 | 显示全部楼层

[求助]一个奇怪的编译错误

实型变量最好用float, 或者double,不要用real
cell_t 不能赋值
thread 也不能赋值
 楼主| 发表于 2008-5-30 18:11:06 | 显示全部楼层

[求助]一个奇怪的编译错误

cell_t 和 thread 好像可以赋值吧?难道一定要改成下面那样吗?
   cell_t  c0;
   Thread *t0;
   c0=-1;
   t0=NULL;
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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