|
[Sponsors] |
udf_names.c(7) : error C2059: syntax error : '}' |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 27, 2010, 15:26 |
udf_names.c(7) : error C2059: syntax error : '}'
|
#1 |
New Member
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Dear All,
I just switched to windows7 64bit. I have Fluent 6.3.2 (64bit) installed on my PC with VisualC++2010 Pro RC. and the environment path variables set for VC++ and Fluent. For a test case I want to run the fluent tutorial model for multiphase flows (VOF). Although I am using SKD to run FLUENT, at the time of compiling the FLUENT UDF, these warnings and errors appear. would you please give me some hints, Thanks M 1 file(s) copied. (system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\win64\2ddp\makefile") 1 file(s) copied. (chdir "libudf")() (chdir "win64\2ddp")() inlet1.c c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(160) : see previous definition of 'stdout' c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(161) : see previous definition of 'stderr' c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(159) : see previous definition of 'stdin' # Generating udf_names.c because of makefile inlet1.obj udf_names.c c:\fluent.inc\fluent6.3.26\src\machine.h(114) : warning C4005: 'stdout' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(160) : see previous definition of 'stdout' c:\fluent.inc\fluent6.3.26\src\machine.h(115) : warning C4005: 'stderr' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(161) : see previous definition of 'stderr' c:\fluent.inc\fluent6.3.26\src\machine.h(116) : warning C4005: 'stdin' : macro redefinition C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(159) : see previous definition of 'stdin' udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof returns 0 Done. |
|
April 28, 2010, 11:59 |
|
#2 |
Member
Join Date: Apr 2009
Posts: 46
Rep Power: 17 |
Make sure the udf_names.c has been created correctly.
udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof returns 0 |
|
April 28, 2010, 23:53 |
|
#3 |
New Member
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Dear Fox
How can I check that? I followed the commands in makefile and it looks like that it doesnt' understand the line below, @sed -n "s/^DEFINE_\([_A-Z]*\)( *\([_a-zA-Z0-9]*\).*)/\{\"\2\", (void (*)())\2, UDF_TYPE_\1\},/p" $(SOURCES) >> $@ But I dont' know what should I do? |
|
April 29, 2010, 01:26 |
|
#4 |
Member
Join Date: Apr 2009
Posts: 46
Rep Power: 17 |
Can u post the UDF definition, or send it to me?
Last edited by fox000002; April 29, 2010 at 03:32. |
|
April 29, 2010, 14:53 |
The UDF file,
|
#5 |
New Member
Mehr
Join Date: Apr 2010
Posts: 3
Rep Power: 16 |
Here is the standard UDF,
#include "udf.h" #include "sg.h" #include "sg_mphase.h" #include "flow.h" #define PI 3.141592654 DEFINE_PROFILE(membrane_speed, /* function name */ th , /* thread */ nv) /* variable number */ { face_t f; real x[ND_ND]; real f_time = RP_Get_Real("flow-time"); begin_f_loop (f,th) { F_CENTROID(x,f,th); if (f_time<=10e-6) {F_PROFILE(f,th,nv) = 3.58*cos(PI*f_time/30e-6); } else F_PROFILE(f,th,nv) = 0; } end_f_loop (f,th) } |
|
April 30, 2010, 04:33 |
|
#6 |
Member
Join Date: Apr 2009
Posts: 46
Rep Power: 17 |
Sed cannot understand your UDF.
Delete the useless comments between UDF name and its parameters, and put them in a single line. Use the following format. Code:
DEFINE_PROFILE(membrane_speed, th, nv) |
|
August 1, 2010, 06:20 |
udf_names.c(7) : error C2059: syntax error : '}'
|
#7 |
Member
ahmad
Join Date: Jul 2010
Posts: 57
Rep Power: 16 |
hi everybody...
i have same error friends,i've defined an udf file and when i compile it,fluent shows me this error message... thank u in advance |
|
January 25, 2016, 10:10 |
|
#8 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16 |
you cannot have any spaces in DEFINE_UDFNAME(a,b,x) syntax
__________________
best regards pblasiak |
|
May 25, 2016, 04:33 |
UDF error
|
#9 |
New Member
jianshu
Join Date: May 2016
Posts: 2
Rep Power: 0 |
I have the same problem and do not know what to do. Please help me.
Copied C:\Users\jianshugao\Desktop\UDF\UDWSPF.c to libudf\src udf_names.c and user_nt.udf files in 2d_host are upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\2d_host\makefile" ") 已复制 1 个文件。 (chdir "libudf")(chdir "win64\2d_host")# Generating ud_io1.h UDWSPF.c # Generating udf_names.c because of UDWSPF.obj udf_names.c udf_names.c(7) : error C2059: 语法错误:“}” udf_names.c(8) : warning C4034: sizeof 返回 0 udf_names.c and user_nt.udf files in 2d_node are upto date. (system "copy "C:\PROGRA~1\ANSYSI~1\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\2d_node\makefile" ") 已复制 1 个文件。 (chdir "libudf")(chdir "win64\2d_node")# Generating ud_io1.h UDWSPF.c # Generating udf_names.c because of UDWSPF.obj udf_names.c udf_names.c(7) : error C2059: 语法错误:“}” udf_names.c(8) : warning C4034: sizeof 返回 0 Done. |
|
May 25, 2016, 07:23 |
|
#10 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
The Fluent manual has the line:
Code:
UDF_EXPORT WS_Functions WetSteamFunctionList = Code:
UDF_EXPORT WS_Functions WetSteamFunctionList= |
|
May 25, 2016, 10:11 |
|
#11 |
New Member
jianshu
Join Date: May 2016
Posts: 2
Rep Power: 0 |
Thanks for your answer.
But it can not help with the missing space added and the same reply is showed as this: udf_names.c(7) : error C2059: 语法错误:“}” udf_names.c(8) : warning C4034: sizeof 返回 0 |
|
May 25, 2016, 11:59 |
|
#12 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Can you show the content of udf_names.c?
|
|
March 29, 2017, 09:55 |
Solution
|
#13 |
New Member
yaobenchun
Join Date: Sep 2016
Location: Beijing
Posts: 1
Rep Power: 0 |
Recently, I wrote a similar code and the same error:
udf_names.c(7) : error C2059: syntax error : '}' udf_names.c(8) : warning C4034: sizeof returns 0 happened to me. It turned out there is a spece before "DEFINE_PROFILE(membrane_speed,th,nv)". After deleting the space, the code complied smoothly. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
compile errors of boundary condition "expDirectionMixed" | liying02ts | OpenFOAM Bugs | 2 | February 1, 2010 21:11 |
error while running paraFoam! | padmanathan | OpenFOAM | 9 | October 13, 2009 06:17 |
attach/detach (valve opening/closing) | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | March 21, 2009 06:18 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |