|
[Sponsors] |
what is syntax error : missing ')' before ';' |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 20, 2011, 15:06 |
what is syntax error : missing ')' before ';'
|
#1 |
Member
Join Date: Mar 2011
Posts: 38
Rep Power: 15 |
I'm pretty sure that I have no problem with the ‘;’ and ')', but still I got that error. Some said it is because of the compiler, but I followed the ansys technical support's direction, using vs 2010 express edition+windows sdk 7.0+.net framework 3.5 sp1 to start fluent in my win7 64bit system.
Fluent can be smoothly started without problem. Please help. Thanks. Deleted old \MECHSE-JACOB-02\users\meng8\desktop estbed\libudf\win64\3ddp_host\libudf.dll \MECHSE-JACOB-02\users\meng8\desktop estbed\libudf\win64\3ddp_node\libudf.dll 1 file(s) copied. (system "copy "C:\ANSYSI~1\v121\fluent"\fluent12.1.4\src\makefil e_nt.udf \MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf\win64\3ddp_h ost\makefile") 1 file(s) copied. (chdir "\MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf")() (chdir "win64\3ddp_host")() C:\Windows\twain.dll C:\Windows\twain_32.dll # Generating ud_io1.h udfsource.c ..\..\src\udfsource.c(102) : error C2065: 'tepflowrate' : undeclared identifier ..\..\src\udfsource.c(102) : warning C4133: 'function' : incompatible types - from 'int *' to 'double *' ..\..\src\udfsource.c(102) : error C2065: 'vol_tot' : undeclared identifier ..\..\src\udfsource.c(102) : warning C4133: 'function' : incompatible types - from 'int *' to 'double *' ..\..\src\udfsource.c(105) : error C2065: 'source' : undeclared identifier ..\..\src\udfsource.c(105) : error C2065: 'tepflowrate' : undeclared identifier ..\..\src\udfsource.c(105) : error C2065: 'vol_tot' : undeclared identifier ..\..\src\udfsource.c(107) : error C2065: 'source' : undeclared identifier ..\..\src\udfsource.c(108) : error C2143: syntax error : missing ')' before ';' ..\..\src\udfsource.c(108) : error C2143: syntax error : missing ';' before ',' ..\..\src\udfsource.c(108) : error C2059: syntax error : ')' '\\MECHSE-JACOB-02\users\meng8\desktop\testbed' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. '\\MECHSE-JACOB-02\users\meng8\desktop\testbed' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. (system "copy "C:\ANSYSI~1\v121\fluent"\fluent12.1.4\src\makefil e_nt.udf \MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf\win64\3ddp_n ode\makefile") '\\MECHSE-JACOB-02\users\meng8\desktop\testbed' CMD.EXE was started with the above path as the current directory. UNC paths are not supported. Defaulting to Windows directory. 1 file(s) copied. (chdir "\MECHSE-JACOB-02\users\meng8\desktop\testbed\libudf")() (chdir "win64\3ddp_node")() C:\Windows\twain.dll C:\Windows\twain_32.dll # Generating ud_io1.h udfsource.c ..\..\src\udfsource.c(22) : error C2143: syntax error : missing ')' before ';' ..\..\src\udfsource.c(22) : error C2059: syntax error : ')' ..\..\src\udfsource.c(23) : error C2143: syntax error : missing ')' before ';' ..\..\src\udfsource.c(23) : error C2059: syntax error : ')' ..\..\src\udfsource.c(89) : error C2143: syntax error : missing ')' before ';' ..\..\src\udfsource.c(89) : error C2059: syntax error : ')' ..\..\src\udfsource.c(90) : error C2143: syntax error : missing ')' before ';' ..\..\src\udfsource.c(90) : error C2059: syntax error : ')' |
|
June 29, 2011, 14:29 |
|
#2 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
I don't know if that was your case, but there is a C rule that can be very annoying for one that is not aware of it. You should put every declaration before any operation. As an example, this produces the kind of error you got:
Code:
int j; j = 1; int i; |
|
March 10, 2015, 03:46 |
|
#3 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
I have encountered the same problem.. Have you resolved it?
|
|
March 10, 2015, 06:59 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
If you have the same error then post your UDF code. The error code states the line number where the error has occurred.
|
|
March 10, 2015, 07:02 |
|
#5 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Thanks for the reply.. code is below
#include "udf.h" #define a 340.26 DEFINE_ON_DEMAND(shock_sensor) { Domain *d; Thread *t; cell_t c; d=Get_Domain(1); real f_shock, velocity; thread_loop_c(t,d) { begin_c_loop(c,t) { velocity=(C_U(c,t)+C_V(c,t)); f_shock = (velocity*C_P_G(c,t))/(a*abs(C_P_G(c,t))); if(f_shock>=1) { C_UDMI(c,t,0)=f_shock; } } end_c_loop(c,t) } } I think I need to change the macro, but not sure... Thanks |
|
March 10, 2015, 07:12 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Are you running in serial or parallel, and what is your error message exactly?
|
|
March 10, 2015, 07:15 |
|
#7 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
First of all, you should declare your variables before assigning values to them as pointed out by Micael in this thread we're currently in.
Try: Code:
Domain *d; Thread *t; cell_t c; real f_shock, velocity; d=Get_Domain(1); |
|
March 10, 2015, 13:08 |
|
#8 | |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
Quote:
UDF is this #include "udf.h" #define A 340.26 DEFINE_ON_DEMAND(shock_sensor) { Domain *d; Thread *t; cell_t c; real f_shock, velocity; d=Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { velocity=(C_U(c,t)+C_V(c,t)); f_shock = (velocity*C_P_G(c,t))/(A*fabs(C_P_G(c,t))); if(f_shock>=1) { C_UDMI(c,t,0)=f_shock; } } end_c_loop(c,t) } } Error is below. # Generating ud_io1.h shock_sensor.c ..\..\src\shock_sensor.c(18) : error C2297: '*' : illegal, right operand has type 'real [2]' ..\..\src\shock_sensor.c(18) : error C2440: 'function' : cannot convert from 'real [2]' to 'double' ..\..\src\shock_sensor.c(18) : warning C4024: 'fabs' : different types for formal and actual parameter 1 Done. Thanks in advance |
||
March 10, 2015, 16:42 |
|
#9 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
See my reply in this thread and please do not post duplicate questions in multiple threads.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
syntax error on config.h | ehooi | Fluent UDF and Scheme Programming | 3 | November 9, 2011 11:05 |
[Other] Turbogrid power syntax | la7low | ANSYS Meshing & Geometry | 0 | January 15, 2011 23:20 |
OpenFOAM file syntax | amtri | OpenFOAM | 5 | August 28, 2010 08:19 |
Interpolation command '-interp-iv' in syntax file | KM | CFX | 4 | October 12, 2007 17:29 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |