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

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

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes
  • 15 Post By chengdi
  • 1 Post By namankothari

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2011, 12:53
Talking Experience: Something about udf_names.c(7): error C2059 when compiling udf
  #1
Member
 
Di Cheng
Join Date: May 2010
Location: Beijing, China
Posts: 47
Rep Power: 16
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
fivos, p36288, alexlupo and 12 others like this.
chengdi is offline   Reply With Quote

Old   October 6, 2012, 07: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
poya0070 likes this.
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: 17
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, 13:58
Default
  #4
New Member
 
Rakesh
Join Date: Jan 2014
Location: Delft
Posts: 13
Rep Power: 12
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, 22:11
Default
  #5
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
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, 15: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, 13:35
Default
  #7
New Member
 
abed
Join Date: Dec 2014
Posts: 13
Rep Power: 12
toghay is on a distinguished road
i love you chengdi
best regards
toghay is offline   Reply With Quote

Old   January 25, 2016, 10:09
Default
  #8
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 16
gaza is on a distinguished road
thanks a lot for this post!
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   September 27, 2018, 10:07
Default
  #9
New Member
 
alvin
Join Date: Aug 2018
Location: HONGKONG
Posts: 5
Rep Power: 8
jiangzili is on a distinguished road
Thank you so much for this information!
jiangzili is offline   Reply With Quote

Reply

Tags
error c2059, fluent, nmake, udf


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 Off
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 15 November 4, 2019 19:05
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 08:14
On Compiling a UDF David Chabot FLUENT 5 May 20, 2005 10:13


All times are GMT -4. The time now is 13:39.