CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   CGNS lib and Fortran compiler (https://www.cfd-online.com/Forums/main/75362-cgns-lib-fortran-compiler.html)

manaliac April 22, 2010 16:41

CGNS lib and Fortran compiler
 
hello,

I downloaded the CGNS lib and installed it with nmake from Visual C++ 2008. It generate cgnslib_f.h and cgnswin_f.h and libcgns.lib.

But when I tried to compile the fortran program which is given under the tests directory from CGNS_LIB files, it generate errors linking: CG_OPEN_F , CG_CLOSE_F etc...

I d'ont know what to do to compile my program successfully, and I wonder what s the use of the ADF's ...

Can someone tell me how to compile this program?

Thank you.

lzgwhy November 28, 2010 00:08

When I used VC++ 2008 to compile CGNS2.5, it is not successful since the following errors. Could you tell me how to compile it?
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

cl -nologo -I. -Iadf -FoWIN32\cgns_error.obj -c cgns_error.c
cgns_error.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(107) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(107) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(107) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(108) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(108) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(108) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(109) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(109) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(109) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(110) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(112) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(113) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(113) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(113) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(116) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(116) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(116) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(117) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(117) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(117) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(118) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(118) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(118) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(119) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(119) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(119) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(120) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(121) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(121) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(121) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(122) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(122) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(122) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(123) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(124) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(124) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(124) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(125) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(125) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(125) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(126) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(126) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(126) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(127) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(127) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(127) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(128) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(128) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(128) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(135) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(135) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(135) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(136) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(136) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(136) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(137) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(137) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(137) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(138) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(139) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(140) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(140) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(140) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(141) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(141) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(141) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(142) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(142) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(142) : error C3304: 'PreAttribute': attribute does not allow unnamed arguments
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(143) : error C2106: '=' : left operand must be l-value
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(143) : error C2057: expected constant expression
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\math.h(143) : fatal error C1003: error count exceeds 100; stopping compilation
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

shirazbj November 29, 2010 06:25

you should read the README file in f2c folder for using FORTRAN.

btw I complied with gcc under win xp, not ms-vc.


All times are GMT -4. The time now is 00:49.