[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #LPJ-211978]: New issue: Syntax-Error in posixio.c line 217,



> Dear Madam or Sir,
>
> compiling the netcdf.tar because the binaries don t link (ticket
> #NCU-160205) gives a syntax error in line 217 in posixio.c.
>
> Unpacked: netcdf.tar as provided by you
> Unpacked: win32...VC6 as provided by you.
> The readme of the win32 followed.
>
> XP, command prompt. vcvars32.bat activated, e.g. the C-Environment
> from Developers Studio.
>
> My own native language is FORTRAN(!) (e.g. not C).
> Level with Fortran: High (since 1979)
> Level with C: Low, e.g. I can follow it as I know Fortran but I really
> don t like it. Thus I might not recognize a simple syntax error that is
> in your distribution and silently corrected by other users.
>
> An experimental int ssize, similar to the declaration a few lines below
> 217 did not help.
>
> Compiled with:
>
> nmake /f msoft.mak as given by you Called from ..... libsrc with
> vcvars32 activated.
>
> config.h was not found.
>
> config.h.in copied to ..... libsrc
>
> ... libsrc included in the CL compiler call (see below).
>
> /Id:\netcdf362\src\libsrc
>
> It compiles quite far until line 217 in posixio.c
>
> In posixio line 217 it reads:
>
> if(write(nciop->fd, vp, extent) != (ssize_t) extent)
>
> ssize_t is not used before but declared some lines below
>
> So: What to do?
>
> Inferred intended logic: netcdf should write "extent" bytes.
> If, comparable to a return code of function write, this amount
> (inferred: ssize_t) is not equal to extent, an error ocurred.
>
> Initial main suspicion: Where should ssize_t be declared and how?
>
> See now the full error:
>
> ********************
>
> 1) config.h not found.
>
> Remedy: config.h.in from the distribution copied as config.h
> into libsrc
>
> 2) Still not found.
>
> In msoft.mak include-file specified (following the /I )
> Thus:
>
>
> !IF  "$(CFG)" == "Debug"
> COPT=   /nologo /W3 /FD /MTd /Gm /Zi /Od /D "_DEBUG"
> !ELSE
> # COPT= /nologo /W3 /FD /MT /O2 /D "NDEBUG" original
> COPT= /nologo /W3 /FD /MT /O2 /Id:\netcdf362\src\libsrc /D "NDEBUG"
> !ENDIF
>
> He proceeds. Then:
>
> 3) Syntaxerror:
>
> nc.obj                    Tue May 20 18:19:24 2008
> fbits.h                 Fri May 26 22:46:46 1995
> ncconfig.h              Thu May 22 19:21:38 1997
> ncio.h                  Tue Jan 03 05:56:28 2006
> netcdf.h                Wed Jan 17 23:51:42 2007
> posixio.c               Tue May 20 18:31:44 2008
> rnd.h                   Wed Dec 11 06:46:54 1996
> posixio.obj     Ziel nicht vorhanden : Target not present
> cl /nologo /W3 /FD /MT /O2 /Id:\netcdf362\src\libsrc /D "NDEBUG"
> /D "WIN32" /D "_WINDOWS" /D "DLL_NETCDF" /D "VERSION"="" /D "DLL_EXPORT"
> /c posixio.c
> posixio.c
> posixio.c(217) : error C2065: 'ssize_t': nichtdeklarierter Bezeichner
> posixio.c(217) : error C2146: Syntaxfehler: Fehlendes ')' vor Bezeichner
> 'extent'
>
> PPS translation start:
> error C2065: non-declared specifier / descriptor
> error C2146; Syntax error: Missing ')' bevore specifier 'extent'
> PPS translation end:
>
> posixio.c(217) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(217) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(217) : error C2143: Syntaxfehler: Es fehlt ')' vor
> 'Bezeichner'
> posixio.c(217) : error C2059: Syntaxfehler: ')'
> posixio.c(218) : error C2143: Syntaxfehler: Es fehlt ';' vor '{'
> posixio.c(241) : error C2146: Syntaxfehler: Fehlendes ';' vor Bezeichner
> 'nread'
> posixio.c(241) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(241) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(241) : error C2143: Syntaxfehler: Es fehlt ';' vor
> 'Bezeichner'
> posixio.c(241) : error C2065: 'nread': nichtdeklarierter Bezeichner
> posixio.c(262) : error C2146: Syntaxfehler: Fehlendes ')' vor Bezeichner
> 'extent'
> posixio.c(262) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(262) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(262) : error C2143: Syntaxfehler: Es fehlt ')' vor
> 'Bezeichner'
> posixio.c(262) : error C2059: Syntaxfehler: ')'
> posixio.c(263) : error C2143: Syntaxfehler: Es fehlt ';' vor '{'
> posixio.c(268) : error C2146: Syntaxfehler: Fehlendes ')' vor Bezeichner
> 'extent'
> posixio.c(268) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(268) : error C2144: Syntaxfehler: '<Unbekannt>' sollte auf
> '<Unbekannt>' folgen
> posixio.c(268) : error C2143: Syntaxfehler: Es fehlt ')' vor
> 'Bezeichner'
> posixio.c(268) : error C2059: Syntaxfehler: ')'
>
> In posixio line 217:
> if(write(nciop->fd, vp, extent) != (ssize_t) extent)
>
> ssize_t is not used before but declared some lines below
>
> ********************
>
> Most sincerely
>
> Peter
> (Dr. Peter P. Smolka)
>
> Email: address@hidden
>
>

You are trying to build with Microsoft tools? Go to the win32/NET and open the
netcdf.sln file. Then build.

The errors you are seeing occur because the configure script is not run in the
normal win32 build process, and, in general, would not work for the windows
user anyway, because its a Bourne shell script and windows can't cope.

So there are many things that are set during the configure process that, on
Windows, must be pre-set and distributed with the build. This is what is in the
win32/NET directory.

Another alternative is to install cygwin (www.cygwin.com) on your machine, and
then build netCDF as usual in the cygwin environment, and then link cygwin.dll
and netcdf.dll in your programs. This is probably the easiest way to get things
working in Windows...

Please let me know if this doesn't help you.

Thanks,

Ed

Ticket Details
===================
Ticket ID: LPJ-211978
Department: Support netCDF
Priority: Normal
Status: Closed