CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Error in Simple UDF! (

Abhya March 14, 2013 09:21

Error in Simple UDF!
Hi everyone!
There's a very simple on demand udf I'm writing ... using DEFINE_ON_DEMAND .. and I dont get the error its on the line where DEFINE_ON_DEMAND is defined .. theCode and error are:

The udf code is :
#include "udf.h"
FILE *fout;
void get_req_cells_coords(Domain *domain, int id)
    real CC[2];
    cell_t c;
    Thread *t = Lookup_Thread(domain, id);
    fprintf(fout,"thread id %d\n", id);
        fprintf(fout, "f%d %g %g %g\n", c, CC[0], CC[1], CC[2]);
    fprintf(fout, "\n");
    Domain *domain;
    domain = Get_Domain(1);
    fout = fopen("req_cells.out", "w");
    get_req_cells_coords(domain, 3);
    get_req_cells_coords(domain, 4);

The error is:

# Generating ud_io1.h
..\..\src\get_req_cells_coords.c(19) : error C2143: syntax error : missing ';' before 'type'

can anyone help me ? :confused::confused:
Im using Microsoft Visual Studio 2010 with FLUENT v14.5

Abhya March 14, 2013 09:36

Another thing I'd like to mention is that I've been able to compile some other udfs using DEFINE_SOURCE without errors ...
but y this doesn't work ???

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