Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #15355 > unrolled thread
| Started by | Arun <abarun22@gmail.com> |
|---|---|
| First post | 2012-01-02 23:25 -0800 |
| Last post | 2012-01-03 07:57 -0500 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.c
Compilation issues while including header stddef.h Arun <abarun22@gmail.com> - 2012-01-02 23:25 -0800
Re: Compilation issues while including header stddef.h Dr Nick <3-nospam@temporary-address.org.uk> - 2012-01-03 07:44 +0000
Re: Compilation issues while including header stddef.h Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-03 07:57 -0500
| From | Arun <abarun22@gmail.com> |
|---|---|
| Date | 2012-01-02 23:25 -0800 |
| Subject | Compilation issues while including header stddef.h |
| Message-ID | <26734ef5-7787-4bf4-86d4-505e6de16d8b@k22g2000prb.googlegroups.com> |
Hello,
I am trying to build a 64bit shared library out of C routines and i
got in to some issues while including the header file stddef.h. I am
using nmake comands (for VS 2008 Ver 9.0) to compile the sources. It
would be much helpful if some body can throw some light on the
following errors i am encountering.
C:\Apps\SC03-Ver14\jm72_orig\src\jm72>nmake /f Makefile.nmake all
arch=win64
Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.
Compiling file hal_adf_c.c
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
\amd64\cl" /c
/DUPPERCASE /DnoFLEXM /D__HDF /DEZXML_NOMMAP /
DNOUNDERSCORE /O
2 /c /I..\..\include /I /I /I..\..\include\jm72 /I"C:\Apps\SC03-
Ver14\prop\CGNS
\include\ADF" /I"C:\Apps\SC03-Ver14\prop\HDF5\1.8.7_x64\include
\hdf5_ser" hal_
adf_c.c /Fohal_adf_c.owin64
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
hal_adf_c.c
..\..\include\jm72\stddef.h(5) : error C2054: expected '(' to follow
'__SIZE_TYP
E__'
..\..\include\jm72\stddef.h(6) : error C2085: '__WCHAR_TYPE__' : not
in formal p
arameter list
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
Studio 9.0\
VC\bin\amd64\cl.EXE"' : return code '0x2'
Stop.
The file stddef.h reads as follows.
#ifndef _STDDEF_H
#define _STDDEF_H
#define NULL ((void *)0)
typedef __SIZE_TYPE__ size_t;
typedef __WCHAR_TYPE__ wchar_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#define offsetof(type, field) ((size_t) &((type *)0)->field)
/* need to do that because of glibc 2.1 bug (should have a way to test
presence of 'long long' without __GNUC__, or TCC should define
__GNUC__ ? */
#if !defined(__int8_t_defined) && !defined(__dietlibc__)
#define __int8_t_defined
typedef char int8_t;
typedef short int int16_t;
typedef int int32_t;
typedef long long int int64_t;
#endif
void *alloca(size_t);
#endif
Here comes the details regarding the C compiler.
C:\Apps\SC03-Ver14\jm72_orig\src\jm72>cl -version
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.21022.08 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '-version'
cl : Command line error D8003 : missing source filename
Any inputs on this would be highly appreciated.
Thanks in advance,
Arun
[toc] | [next] | [standalone]
| From | Dr Nick <3-nospam@temporary-address.org.uk> |
|---|---|
| Date | 2012-01-03 07:44 +0000 |
| Message-ID | <87aa656xj0.fsf@temporary-address.org.uk> |
| In reply to | #15355 |
Arun <abarun22@gmail.com> writes:
[much snipping]
> Compiling file hal_adf_c.c
> "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin
> \amd64\cl" /c
> hal_adf_c.c
> ..\..\include\jm72\stddef.h(5) : error C2054: expected '(' to follow
> '__SIZE_TYP
> E__'
> ..\..\include\jm72\stddef.h(6) : error C2085: '__WCHAR_TYPE__' : not
> in formal p
> arameter list
>
> The file stddef.h reads as follows.
>
> #ifndef _STDDEF_H
> #define _STDDEF_H
>
> #define NULL ((void *)0)
> typedef __SIZE_TYPE__ size_t;
> typedef __WCHAR_TYPE__ wchar_t;
> typedef __PTRDIFF_TYPE__ ptrdiff_t;
The problem is almost certainly in hal_adf_c.c before you #include
stddef.h. Or in another .h file #included immediately before stddef.h
I usually get this sort of thing by forgetting the semicolon on the end
of a structure definition.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-01-03 07:57 -0500 |
| Message-ID | <jduu02$ave$1@dont-email.me> |
| In reply to | #15356 |
On 1/3/2012 2:44 AM, Dr Nick wrote:
> Arun<abarun22@gmail.com> writes:
>> [...]
>> The file stddef.h reads as follows.
>>
>> #ifndef _STDDEF_H
>> #define _STDDEF_H
>>
>> #define NULL ((void *)0)
>> typedef __SIZE_TYPE__ size_t;
>> typedef __WCHAR_TYPE__ wchar_t;
>> typedef __PTRDIFF_TYPE__ ptrdiff_t;
>
> The problem is almost certainly in hal_adf_c.c before you #include
> stddef.h. Or in another .h file #included immediately before stddef.h
Another possibility: The <stddef.h> in question belongs with
a different compiler, one that has __SIZE_TYPE__ etc. as built-ins.
Two points about the exhibited <stddef.h> make this hypothesis
believable (although they don't prove it, of course): First, there's
no Microsoft copyright at the start of the file, suggesting it's not
part of a Microsoft product. Second, the original has a comment
about working within the Gnu frameworks (see the OP; it's snipped
from the response), and that's not something I'd expect Microsoft to
be much concerned about.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c
csiph-web