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

Undeclared Identifier Errof UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 27, 2012, 17:36
Default Undeclared Identifier Errof UDF
  #1
New Member
 
Stefano Capra
Join Date: Mar 2012
Posts: 8
Rep Power: 3
SteveGoat is on a distinguished road
Hi everyone,
I'm running fluent on windows xp 32bit and trying to compile a UDF with Visual Studio 9.0 (2008). I've done everything reported within this website:

-set the environmental variables for Visual Studio
-set the environmental variable for fluent
-launch fluent from the Visual C++ command window after browsing to the .cas and .dat folder

However I'm still not able to compile it correctly.
It is worth noting that the some source files compile perfectly on a Linux 64bit machine!


1 file copiati.
1 file copiati.
1 file copiati.
(system "copy C:\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\3d\makefile")
1 file copiati.
(chdir "libudf")()
(chdir "ntx86\3d")()
compute_cs.c
c:\fluent.inc\fluent6.3.26\src\global.h(194) : warning C4005: 'SQR' : macro redefinition
c:\documents and settings\capra\desktop\prove fluent\libudf\src\nrutil.h(12) : see previous definition of 'SQR'
..\..\src\compute_cs.c(41) : error C2275: 'real' : illegal use of this type as an expression
c:\fluent.inc\fluent6.3.26\src\global.h(158) : see declaration of 'real'
..\..\src\compute_cs.c(41) : error C2146: syntax error : missing ';' before identifier 'd'
..\..\src\compute_cs.c(41) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(41) : error C2109: subscript requires array or pointer type
..\..\src\compute_cs.c(42) : error C2275: 'real' : illegal use of this type as an expression
c:\fluent.inc\fluent6.3.26\src\global.h(158) : see declaration of 'real'
..\..\src\compute_cs.c(42) : error C2146: syntax error : missing ';' before identifier 'e'
..\..\src\compute_cs.c(42) : error C2065: 'e' : undeclared identifier
..\..\src\compute_cs.c(42) : error C2109: subscript requires array or pointer type
..\..\src\compute_cs.c(43) : error C2143: syntax error : missing ';' before 'type'
..\..\src\compute_cs.c(44) : error C2143: syntax error : missing ';' before 'type'
..\..\src\compute_cs.c(45) : error C2275: 'bool' : illegal use of this type as an expression
..\..\src\compute_cs.c(10) : see declaration of 'bool'
..\..\src\compute_cs.c(45) : error C2146: syntax error : missing ';' before identifier 'use_stat'
..\..\src\compute_cs.c(45) : error C2065: 'use_stat' : undeclared identifier
..\..\src\compute_cs.c(48) : error C2065: 'use_stat' : undeclared identifier
..\..\src\compute_cs.c(49) : error C2065: 'nlambda' : undeclared identifier
..\..\src\compute_cs.c(50) : error C2065: 'nmean' : undeclared identifier
..\..\src\compute_cs.c(51) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(54) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(65) : error C2065: 'use_stat' : undeclared identifier
..\..\src\compute_cs.c(68) : error C2065: 'nmean' : undeclared identifier
..\..\src\compute_cs.c(68) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(68) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(68) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(69) : error C2065: 'nmean' : undeclared identifier
..\..\src\compute_cs.c(69) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(69) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(69) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(70) : error C2065: 'nmean' : undeclared identifier
..\..\src\compute_cs.c(70) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(70) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(70) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(79) : error C2065: 'use_stat' : undeclared identifier
..\..\src\compute_cs.c(91) : error C2065: 'use_stat' : undeclared identifier
..\..\src\compute_cs.c(93) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(94) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(95) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(96) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(97) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(98) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(99) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(100) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(101) : error C2065: 'ngrad' : undeclared identifier
..\..\src\compute_cs.c(155) : error C2065: 'n' : undeclared identifier
..\..\src\compute_cs.c(155) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(155) : warning C4047: 'function' : 'real *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(155) : warning C4024: 'tred2' : different types for formal and actual parameter 2
..\..\src\compute_cs.c(155) : error C2065: 'e' : undeclared identifier
..\..\src\compute_cs.c(155) : warning C4047: 'function' : 'real *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(155) : warning C4024: 'tred2' : different types for formal and actual parameter 3
..\..\src\compute_cs.c(157) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(157) : warning C4047: 'function' : 'real *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(157) : warning C4024: 'tqli' : different types for formal and actual parameter 1
..\..\src\compute_cs.c(157) : error C2065: 'e' : undeclared identifier
..\..\src\compute_cs.c(157) : warning C4047: 'function' : 'real *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(157) : warning C4024: 'tqli' : different types for formal and actual parameter 2
..\..\src\compute_cs.c(157) : error C2065: 'n' : undeclared identifier
..\..\src\compute_cs.c(159) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(159) : warning C4047: 'function' : 'real *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(159) : warning C4024: 'eigsrt' : different types for formal and actual parameter 1
..\..\src\compute_cs.c(159) : error C2065: 'n' : undeclared identifier
..\..\src\compute_cs.c(162) : error C2065: 'nlambda' : undeclared identifier
..\..\src\compute_cs.c(162) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(162) : error C2109: subscript requires array or pointer type
..\..\src\compute_cs.c(163) : error C2065: 'nlambda' : undeclared identifier
..\..\src\compute_cs.c(163) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(163) : error C2109: subscript requires array or pointer type
..\..\src\compute_cs.c(164) : error C2065: 'nlambda' : undeclared identifier
..\..\src\compute_cs.c(164) : error C2065: 'd' : undeclared identifier
..\..\src\compute_cs.c(164) : error C2109: subscript requires array or pointer type
..\..\src\compute_cs.c(365) : 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\compute_cs.c(365) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(366) : 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\compute_cs.c(366) : error C2146: syntax error : missing ';' before identifier 'c'
..\..\src\compute_cs.c(366) : error C2065: 'c' : undeclared identifier
..\..\src\compute_cs.c(367) : error C2275: 'face_t' : illegal use of this type as an expression
C:\Fluent.Inc\fluent6.3.26\src\mem.h(168) : see declaration of 'face_t'
..\..\src\compute_cs.c(367) : error C2146: syntax error : missing ';' before identifier 'f'
..\..\src\compute_cs.c(367) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(370) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(370) : warning C4047: '=' : 'int' differs in levels of indirection from 'thread_struct *'
..\..\src\compute_cs.c(370) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(370) : warning C4047: '!=' : 'void *' differs in levels of indirection from 'int'
..\..\src\compute_cs.c(370) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(370) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(370) : error C2223: left of '->next' must point to struct/union
..\..\src\compute_cs.c(372) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(372) : error C2223: left of '->nelements' must point to struct/union
..\..\src\compute_cs.c(372) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(372) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(372) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(377) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(377) : error C2223: left of '->flags' must point to struct/union
..\..\src\compute_cs.c(384) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(384) : error C2223: left of '->storage' must point to struct/union
..\..\src\compute_cs.c(384) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(385) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(385) : error C2223: left of '->t0' must point to struct/union
..\..\src\compute_cs.c(386) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(386) : error C2223: left of '->storage' must point to struct/union
..\..\src\compute_cs.c(386) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(387) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(387) : error C2223: left of '->t1' must point to struct/union
..\..\src\compute_cs.c(390) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(390) : error C2223: left of '->storage' must point to struct/union
..\..\src\compute_cs.c(390) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(390) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(390) : error C2223: left of '->storage' must point to struct/union
..\..\src\compute_cs.c(390) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(390) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(390) : error C2223: left of '->storage' must point to struct/union
..\..\src\compute_cs.c(390) : error C2065: 'f' : undeclared identifier
..\..\src\compute_cs.c(400) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(400) : error C2223: left of '->flags' must point to struct/union
..\..\src\compute_cs.c(407) : error C2065: 'tf' : undeclared identifier
..\..\src\compute_cs.c(407) : fatal error C1003: error count exceeds 100; stopping compilation
nrutil.c
Generating Code...

Done.

Does anyone have the same problem?
Thank you so much
Steve
SteveGoat is offline   Reply With Quote

Old   May 2, 2012, 10:04
Default
  #2
New Member
 
Join Date: Apr 2012
Location: Stockholm
Posts: 2
Rep Power: 0
Remedios is on a distinguished road
Hello,

Could you solve this problem?
Remedios is offline   Reply With Quote

Old   May 17, 2012, 05:37
Default
  #3
New Member
 
Stefano Capra
Join Date: Mar 2012
Posts: 8
Rep Power: 3
SteveGoat is on a distinguished road
No I'm sorry
SteveGoat is offline   Reply With Quote

Old   May 17, 2012, 11:19
Default
  #4
New Member
 
Join Date: Apr 2012
Location: Stockholm
Posts: 2
Rep Power: 0
Remedios is on a distinguished road
I could solve it. My problem was the UDF I was using was written in Linux and I was using it in Windows. I noticed that I needed to write my data type first. For example, for your error " 'real' : illegal use of this type as an expression", define your variable at the top of your loop before any declaration.
Remedios is offline   Reply With Quote

Old   May 18, 2012, 03:27
Default
  #5
New Member
 
Stefano Capra
Join Date: Mar 2012
Posts: 8
Rep Power: 3
SteveGoat is on a distinguished road
Hi, that's a great news, I'm still dealing with it. What do you mean exactly? Do you declare all of them even if are local variables at the top of the code?
Thanks
STefano
SteveGoat is offline   Reply With Quote

Reply

Tags
compile error, udf, unclared identifier, windows xp

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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
Problem with UDF compiling for kTkLW model Wantami FLUENT 0 July 18, 2011 05:11
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 18:54
solving a conduction problem in FLUENT using UDF Avin2407 Fluent UDF and Scheme Programming 0 April 13, 2010 01:49
UDF compilation problem -- "undeclared variable" Henrik Ström FLUENT 1 September 21, 2005 05:25


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