CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Experience: Something about udf_names.c(7): error C2059 when compiling udf

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree9Likes
  • 9 Post By chengdi

Reply
 
LinkBack Thread Tools Display Modes
Old   March 6, 2011, 12:53
Talking Experience: Something about udf_names.c(7): error C2059 when compiling udf
  #1
New Member
 
Di Cheng
Join Date: May 2010
Posts: 8
Rep Power: 7
chengdi is on a distinguished road
Phenomena:
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof 0

Solution:
delete any whitespace character adjacent to the string "DEFINE_XXXX".
It should only be look like this:
Code:
DEFINE_XXX(p1,p2,p3)
and recompile.

Comment:
This error costs me 4 hours...

Actually I'd like to call it this error a bug which stems from the sentence below in the makefile:

Code:
@sed -n "s/^DEFINE_\([_A-Z]*\)( *\([_a-zA-Z0-9]*\).*)/\{\"\2\", (void (*)())\2, UDF_TYPE_\1\},/p" $(SOURCES) >> $@


I do not understand how it works. I think it is used to extract prototype information of the macro and write it to the udf_data[] array in udf_names.c file. However it cannot identify the MACRO with adjacent whitespace.

I hope someone good at makefile could make a patch on this. It must be very easy to professional coders.

Reference:
http://board.fluent.com/ubb/Forum2/HTML/000119.html
p36288, alexlupo, Heat80 and 6 others like this.
chengdi is offline   Reply With Quote

Old   October 6, 2012, 06:08
Default
  #2
New Member
 
Naman
Join Date: Jul 2012
Posts: 1
Rep Power: 0
namankothari is on a distinguished road
Hey Cheng,

Really your information was very helpful. It worked out !!!

Thanks
namankothari is offline   Reply With Quote

Old   January 7, 2014, 17:07
Default
  #3
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 8
isabel is on a distinguished road
Very good advice, thank you very much. I had written DEFINE_PROFILE (T, thread, position) instead DEFINE_PROFILE(T, thread, position)
isabel is offline   Reply With Quote

Old   July 10, 2014, 12:58
Default
  #4
New Member
 
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 10
Rep Power: 3
rsarma is on a distinguished road
Indeed a very good advice. Really appreciate such posts from people in such forums. Thank you.
rsarma is offline   Reply With Quote

Old   July 10, 2014, 21:11
Default
  #5
Senior Member
 
Join Date: Aug 2011
Posts: 315
Rep Power: 12
blackmask will become famous soon enough
[QUOTE=chengdi;298107]

Actually I'd like to call it this error a bug which stems from the sentence below in the makefile:

Code:
@sed -n "s/^DEFINE_\([_A-Z]*\)( *\([_a-zA-Z0-9]*\).*)/\{\"\2\", (void (*)())\2, UDF_TYPE_\1\},/p" $(SOURCES) >> $@


If you want to allow any number of spaces between "DEFINE_XXX" and "(", then the "sed" command should be adapted to
Code:
sed -n "s/^DEFINE_\([_A-Z]*\) *( *\([_a-zA-Z0-9]*\).*)/\{\"\2\", (void (*)())\2, UDF_TYPE_\1\},/p"
blackmask is offline   Reply With Quote

Old   September 26, 2014, 14:32
Default
  #6
New Member
 
Mari
Join Date: Jul 2014
Posts: 2
Rep Power: 0
marinagr is on a distinguished road
Thank you so much for this information! It worked out fine for me!
marinagr is offline   Reply With Quote

Old   May 18, 2015, 12:35
Default
  #7
New Member
 
abed
Join Date: Dec 2014
Posts: 7
Rep Power: 2
toghay is on a distinguished road
i love you chengdi
best regards
toghay is offline   Reply With Quote

Reply

Tags
error c2059, fluent, nmake, udf

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
About UDF compiling issues: 'nmake' Haoyin Shan Fluent UDF and Scheme Programming 7 January 2, 2013 11:49
Compiling UDF on a cluster Adya FLUENT 1 December 14, 2009 12:30
UDF compiling problem in Flient 6.3 jeevan kumar FLUENT 2 February 25, 2009 01:43
udf compiling problem akr FLUENT 3 August 22, 2007 07:14
On Compiling a UDF David Chabot FLUENT 5 May 20, 2005 09:13


All times are GMT -4. The time now is 10:41.