|
[Sponsors] |
February 20, 2020, 19:28 |
offset: undeclared variable
|
#1 |
New Member
Join Date: Feb 2020
Posts: 1
Rep Power: 0 |
hi everybody,
I have some problem with compiling my udf. when I want to load the udf, this error apears: "Error: C:/Users/wswwd/AppData/Local/Temp/udf code.c.4708.0.c: line 83: offset: undeclared variable" I don't know how to fix it please help me, thank you very much. Last edited by dakun; March 13, 2020 at 23:29. |
|
February 21, 2020, 01:40 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
if this is full code, than remove line 83
Code:
offset=Reserve_User_Scalar_Vars(3);
__________________
best regards ****************************** press LIKE if this message was helpful |
|
February 21, 2020, 16:13 |
Declaration
|
#3 |
Senior Member
|
As suggested, it can simply be removed if this is the only library using the UDMs. However, if you wish to use it, may be in the future, the variable offset needs to be declared and initialized. This is not a Fluent defined variable. It is another C variable defined by the user and can have any name within the constraints specified by the language and Fluent. To declare and initialize, use the following command
static int offset = UDM_UNRESERVED; Do note that this needs to be defined as a global variable, therefore, has to be outside DEFINE_ functions. If it is not global, other library or function will not be able to read it and that renders its objective futile.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
Tags |
compile, udf, undeclared variable |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compilation Error | vizvaz | Fluent UDF and Scheme Programming | 2 | January 6, 2017 05:19 |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 08:11 |
Errors in UDF | shashank312 | Fluent UDF and Scheme Programming | 6 | May 30, 2013 21:30 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 10:14 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |