CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF compiled error, please help (https://www.cfd-online.com/Forums/fluent/41282-udf-compiled-error-please-help.html)

GBLiu June 6, 2006 20:43

UDF compiled error, please help
 
Hi all, i use windows and microsoft visual studio .net 2003 on my system,and i start the fluent according to Ravi's suggestion:

STEP 1: Place the source file in the folder which contain case & data file (place it in C-Drive) [Create a new folder in C-Drive and place the case and data files and the Source file (.c file)]

STEP 2: Start --> All Programs --> Microsoft Visual Studio .NET 2003 --> Visual Studio .NET Tools --> Visual Studio .NET 2003 Command Prompt (it opens a command prompt)

STEP 3: In the command prompt browse the folder in which the case & data files and the source files are placed

STEP 4: Type "fluent 2ddp &" (it opens FLUENT console)

STEP 5: File --> Read --> Case & Data Files (browse for the case and data files)

STEP 6: Define --> User-Defined --> Functions --> Compiled

STEP 7: Add the source files and click BUILD

However,there are some errors in the file udf_names.c generated automatically, the error information are below:

"# Generating udf_names.c because of makefile case.obj udf_names.c

udf_names.c(7) : error C2059: syntax error : "}"

udf_names.c(8) : warning C4034: sizeof return 0 "

then i check this file udf_names.c, its content is :

"/* This file generated automatically. */

/* Do not modify. */

#include "udf.h"

#include "prop.h"

#include "dpm.h"

__declspec(dllexport) UDF_Data udf_data[] = {

}; ==c(7) : error C2059: syntax error : "}"==

__declspec(dllexport) int n_udf_data =sizeofudf_data)/sizeof(UDF_Data);

#include "version.h"

__declspec(dllexport) void UDF_Inquire_Release(int *major, int *minor, int *revision)

{

*major = RampantReleaseMajor;

*minor = RampantReleaseMinor;

*revision = RampantReleaseRevision;

}"

so i don't know what's wrong with the automatically generated file "udf_names.c", and i can not load the library. And i try this process by a very simple source file, and it content is:

#include "udf.h"

DEFINE_SOURCE(cell_uds4_source,c,t,ds,eqn)

{

double source,dt,temp1,temp2,ct;

source=0.0;

return source;

}

i still get the same error information, please kindly help me, bilons of thanks.

GBLiu


Miri June 7, 2006 06:02

Re: UDF compiled error, please help
 
Hello try using real insead of double

adriano June 7, 2006 06:07

Re: UDF compiled error, please help
 
to build the library it is important that your case file is in the same directory of your UDF file (i.e.: udf.c).

in your case there are any sintax error

(udf_names.c(7) : error C2059: syntax error : "}" )

udf_names.c(8) : warning C4034: sizeof return 0 "

)

First u must delete them! It may helpfull. Regards

Adriano

GBLiu June 7, 2006 06:24

Re: UDF compiled error, please help
 
thanks Miri and adriano for your precious help, first:I change the double to real, and use Fluent 6.1.22 version not the 6.2.16 version, the error mentioned above disappeared, but the new error appeared:"..\..\src\udf.h(47) : fatal error C1083: Cannot open include file: 'six_dof.h': No such file or directory"; second: I am sure that my case file and my udf.c file in the same direction, and the problem is these errors are related to the automatically generated file "udf_names.c" not my own udf file. please help me!

GBliu

GBLiu June 7, 2006 20:31

Re: UDF compiled error, please help
 
At the moment, the problem is solved, thanks all. my enviromental variables are ok, but my own UDF file is not written regularly, it is the error sources, so the C compiler can not correctly compile it. thanks again! GBLiu


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