CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Compilation error with C++ header file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2007, 11:54
Default Compilation error with C++ header file
  #1
Jack Martinez
Guest
 
Posts: n/a
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.

  Reply With Quote

Old   June 15, 2007, 19:33
Default Re: Compilation error with C++ header file
  #2
Tomasz Bednarz
Guest
 
Posts: n/a
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

  Reply With Quote

Old   June 16, 2007, 08:40
Default compatibility of C++ with UDF (FLUENT )!
  #3
Jack Martinez
Guest
 
Posts: n/a
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
  Reply With Quote

Old   June 16, 2007, 09:27
Default Re: compatibility of C++ with UDF (FLUENT )!
  #4
Tomasz Bednarz
Guest
 
Posts: n/a
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
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
1.7.x Environment Variables on Linux 10.04 rasma OpenFOAM Installation 9 July 30, 2010 04:43
OpenFOAM Install Script ljsh OpenFOAM Installation 82 October 12, 2009 11:47
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 04:26
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 18:45.