CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Strange error building UDF (https://www.cfd-online.com/Forums/fluent-udf/97356-strange-error-building-udf.html)

rik February 15, 2012 09:32

Strange error building UDF
 
Hi!

I'm trying to build an UDF with Fluent, but when I want to build it, it appears a strange error :

1 file(s) copied.
1 file(s) copied.
(system "copy "C:\PROGRAMS\FLUENT_121\v121\fluent"\fluent12.1.4\ src\makefile_nt.udf libudf\win64\3d\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
# Generating ud_io1.h
transfert_temp.c
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2143: syntax error : missing '{' before ':'
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2059: syntax error : ':'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2061: syntax error : identifier 'CX_DLL_GetProc'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : ';'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : 'type'

Done.

With this UDF, I want to copy wall temperature from a wall to another.
My UDF looks like that :
#include "udf.h"
#define ID1 3
#define ID_TWIN1 13
#define MYDEBUG 1

DEFINE_ON_DEMAND(compute_twin)
{
Domain *d=Get_Domain(1);
face_t f,f_twin;
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
Thread *tf=Lookup_Thread(d,ID1);

real y_translation[]={0,-88,0};
real y_twin[3],y[3];
real dist=1e20;

begin_f_loop(f,tf)
{

F_CENTROID(y,f,tf);

NV_VV(y,=,y,-,y_translation);

begin_f_loop(f_twin,t_twin)
{

F_CENTROID(y_twin,f_twin,t_twin);

NV_VV(y_twin,=,y,-,y_twin);


if (NV_MAG(y_twin)<dist)
{
dist=NV_MAG(y_twin);
F_UDMI(f,tf,0)=f_twin;
#if MYDEBUG
C_UDMI(F_C0(f,tf),THREAD_T0(tf),0)=f_twin;
#endif
}
}
end_f_loop(f_twin,t_twin)
}
end_f_loop(f,tf)
}

DEFINE_PROFILE(apply_temp,tf,nv)
{
Domain *d=Get_Domain(1);
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
face_t f,f_twin;

begin_f_loop(f,tf)
{
f_twin=(int)F_UDMI(f,tf,0);
F_PROFILE(f,tf,nv)=F_T(f_twin,t_twin);
}
end_f_loop(f,tf)
}

What should have to do to erase this error? Do you have any idea?

Thanks for the help.

Ryk

villager February 17, 2012 17:04

Maybe..
 
Try this:)
http://www.cfd-online.com/Forums/flu...tml#post271119

You might have this problem, all error messages are the same.
"The Problem was that you didn't check the box "Visual c++ compilers" when I installed the SDK. Reinstall SDK checked that box, that will solve your problem."

I've searched in Google this string:
src\config.h error C2143: syntax error : missing '{ 'before ':'

gearboy February 19, 2012 19:19

Maybe you have used some non-English/unicode folder. You'd better put the case in English folders without space in folder name.


Quote:

Originally Posted by rik (Post 344596)
Hi!

I'm trying to build an UDF with Fluent, but when I want to build it, it appears a strange error :

1 file(s) copied.
1 file(s) copied.
(system "copy "C:\PROGRAMS\FLUENT_121\v121\fluent"\fluent12.1.4\ src\makefile_nt.udf libudf\win64\3d\makefile")
1 file(s) copied.
(chdir "libudf")()
(chdir "win64\3d")()
# Generating ud_io1.h
transfert_temp.c
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2143: syntax error : missing '{' before ':'
c:\programs\fluent_121\v121\fluent\fluent12.1.4\sr c\config.h(110) : error C2059: syntax error : ':'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2061: syntax error : identifier 'CX_DLL_GetProc'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : ';'
C:\PROGRAMS\FLUENT_121\v121\fluent\fluent12.1.4\co rtex\src\dll.h(68) : error C2059: syntax error : 'type'

Done.

With this UDF, I want to copy wall temperature from a wall to another.
My UDF looks like that :
#include "udf.h"
#define ID1 3
#define ID_TWIN1 13
#define MYDEBUG 1

DEFINE_ON_DEMAND(compute_twin)
{
Domain *d=Get_Domain(1);
face_t f,f_twin;
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
Thread *tf=Lookup_Thread(d,ID1);

real y_translation[]={0,-88,0};
real y_twin[3],y[3];
real dist=1e20;

begin_f_loop(f,tf)
{

F_CENTROID(y,f,tf);

NV_VV(y,=,y,-,y_translation);

begin_f_loop(f_twin,t_twin)
{

F_CENTROID(y_twin,f_twin,t_twin);

NV_VV(y_twin,=,y,-,y_twin);


if (NV_MAG(y_twin)<dist)
{
dist=NV_MAG(y_twin);
F_UDMI(f,tf,0)=f_twin;
#if MYDEBUG
C_UDMI(F_C0(f,tf),THREAD_T0(tf),0)=f_twin;
#endif
}
}
end_f_loop(f_twin,t_twin)
}
end_f_loop(f,tf)
}

DEFINE_PROFILE(apply_temp,tf,nv)
{
Domain *d=Get_Domain(1);
Thread *t_twin=Lookup_Thread(d,ID_TWIN1);
face_t f,f_twin;

begin_f_loop(f,tf)
{
f_twin=(int)F_UDMI(f,tf,0);
F_PROFILE(f,tf,nv)=F_T(f_twin,t_twin);
}
end_f_loop(f,tf)
}

What should have to do to erase this error? Do you have any idea?

Thanks for the help.

Ryk


rik February 21, 2012 08:38

Hy,

I've solved my problem.

I install Microsoft SDK 7.1 and Visual Studio Professionnal 2010 for windows 64 bit, and I launch Fluent with the Visual studio command prompt x64.

Thanks all for the help.

Ryk

sadone December 5, 2018 08:35

Quote:

Originally Posted by rik (Post 345527)
Hy,

I've solved my problem.

I install Microsoft SDK 7.1 and Visual Studio Professionnal 2010 for windows 64 bit, and I launch Fluent with the Visual studio command prompt x64.

Thanks all for the help.

Ryk

hey there ive done exact as u said and same problem


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