CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Compilation error with C++ header file (https://www.cfd-online.com/Forums/fluent/45044-compilation-error-c-header-file.html)

Jack Martinez June 15, 2007 11:54

Compilation error with C++ header file
 
Hello again

When I tried to compile a UDF with a < iostream.h > as one of the header file using interpreted method in Fluent, it gave error:

Error: iostream: line 14: parse error.

and when I tried to compile it using shared library, it built a shared library with this error message:

"C:\Programme\Microsoft Visual Studio\VC98\Include\eh.h(32) : fatal error C1189: #Fehler : "eh.h is only for C++!"

and when I tried to link this build library it gave this error message:

Opening library "libudf"... "Error: open_udf_library: The system cannot find the indicated file."

Could someone please explain what preliminary steps required to be followed to link/use C++ functions and programs with UDF in Fluent.

Regards

Jack Martinez.


Tomasz Bednarz June 15, 2007 19:33

Re: Compilation error with C++ header file
 
Jack,

As for UDF, I recommend you to use plain C, instead of C++. Therefore use use stdio.h functions for reading, writing, parsing etc... As for iostream.h, new visual studio have some changes in default libraries and if i remember well you should do #include <iostream> instead of #include <iostream.h>.

Another thing is: DO NOT USE interpreted version, but USE compiled version method in Fluent if you want to use external c/c++ features... internal compiler is very limited, remember about it...

kindest regards, Tomasz


Jack Martinez June 16, 2007 08:40

compatibility of C++ with UDF (FLUENT )!
 
Hello Tomasz,

Many thanks for ur reply..

I have to use C++ along with my UDF in Fluent as I said before I have to postprocess fluent result for radiation modeling and further..

I even tried to implement it using compilation method but it didn't work out...

Does modifyiing the env variables or including some header file in the path can lead to solution...

I am currently working in Windows but finaly I have to implement it in Linux ...

Regards Jack

Tomasz Bednarz June 16, 2007 09:27

Re: compatibility of C++ with UDF (FLUENT )!
 
Jack,

Under Linux all is simpler and straightforward -> GNU C/C++ is included by deafult into the system and you really don't need to do anything when using compiled version of UDF,

Send your UDF code to my email - I'll check it out if you have not enough experience in C/C++, maybe i'll be able to give you good clues on that,

env variables they give only paths for compiler...

kindest regards, Tomasz


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