Article View: microsoft.public.vc.language
Article #1Compiling a C program with MS Visual Studio 6.0 or Borland C/C++ 5
From: Walter Briscoe
Date: Tue, 01 Apr 2003 07:28
Date: Tue, 01 Apr 2003 07:28
105 lines
5452 bytes
5452 bytes
In message <06c201c2f7d1$7e331e20$2f01280a@phx.gbl> of Mon, 31 Mar 2003
14:04:25 in microsoft.public.vc.language, Ren� Dalle <rdalle@ncf.ca>
writes
>OK here is more info:
>
>The module I am trying to compile:
>
>#define WIN32_LEAN_AND_MEAN // Trim the excess fat
>from Windows
>#include <Windows.h>
>#include <gl/gl.h>
>#include <gl/glu.h>
[snip]
>
>The file "excpt.h" is included by "windows.h"
>
>line 72 is the typedef:
>/*
> * Exception disposition return values.
> */
>typedef enum _EXCEPTION_DISPOSITION {
> ExceptionContinueExecution,
> ExceptionContinueSearch,
> ExceptionNestedException,
> ExceptionCollidedUnwind
>} EXCEPTION_DISPOSITION;
[snip]
>--------------------Configuration: Wglut - Win32 Debug-----
>---------------
>Compiling...
>WGlutCallBack.c
>WGlutError.c
>d:\cpp\mscpp\vc98\include\excpt.h(72) : error C2143:
>syntax error : missing '{' before 'enum [tag]'
[snip]
>>-----Original Message-----
>>In article <031101c2f721$5ae7d740$3401280a@phx.gbl>,
>>=?iso-8859-1?Q?Dalle_Ren=E9?= (rdalle@ncf.ca) says...
>>> Hello,
>>Hi.
>>
>>> I am trying to compile some C programs using MS Visual
>>> Studio and I get the
>>> following error messages in excpt.h:
>>>
>>> d:\cpp\mscpp\vc98\include\excpt.h(72) : error C2143:
>>> syntax error : missing '{' before 'enum [tag]'
[snip]
I am afraid that you have made a second useless posting. Let me try to
help. If you post code, please trim it so it your readers can try to
compile it. Posting code which wraps to illegality is abusive;
references to private include files are similarly abusive. Do NOT try to
solve this problem in place; that is too hard. Take a copy of your
project which uses a copy of WGlutError.c. Remove all other sources from
that project. Compile the copy. If this succeeds, find the deficiency in
your copy process. If it fails, trim fat from the copy until the problem
vanishes; restore as little as possible to produce the problem; you are
now in a position to analyse the problem. This can't sensibly be done in
the IDE; When a project x.dsp builds something, it writes x.plg.
In a command line window: run vcvars32.bat to create a compilation
environment and run the failing command line from the .plg. If it does
not fail, you do not have a copy environment or have misanalysed the
.plg. Let us suppose the failing line is cl.exe /c copy.c.
Append /P /C to that command line and run the new command line. That
should produce a file called copy.i containing the source actually read
by the compiler after pre-processing. Find the line corresponding to
d:\cpp\mscpp\vc98\include\excpt.h(72) in copy.i. Look for the token
before that token. Your problem should be obvious! I suspect your code
is actually equivalent to something like the following;
C:\WINNT\Temp\42> type 42.cpp
// Next definition should break Windows.h in excpt.h at line 72
#define _EXCEPTION_DISPOSITION {};
// #define ExceptionCollidedUnwind }
// #define ExceptionContinueExecution }
#define WIN32_LEAN_AND_MEAN // Trim the excess fat from Windows
#include <Windows.h>
C:\WINNT\Temp\42>
In other words, you are using _EXCEPTION_DISPOSITION in a conflicting
fashion. Please report your further experience.
I note your similar problem in news://borland.public.cpp.borlandcpp
where you wrote
In message <3e8787fc$1@newsgroups.borland.com> of Sun, 30 Mar 2003
19:07:20 in borland.public.cpp.borlandcpp, Ren� Dalle <rdalle@ncf.ca>
writes
>Hello,
>
>I am trying to compile some C programs using MS Visual Studio and I get the
>following error messages in excpt.h:
>
> Info :Compiling D:\Cpp\bc5\myprojects\wglut\wgluterror.c
> Error: excpt.h(285,8):Declaration syntax error
> Error: excpt.h(305,31):Declaration syntax error
>
>Would anybody has any idea what is happening, or is there an updated header
>file somewhere? (it is a Boarland header)
The problem has to be in your code. I am cross-posting this there and
suggest you should have done the same if you wanted your problem
discussed in two newsgroups. I am close to letting you fester!
--
Walter Briscoe
Technical Details
Message-ID:
<akChPyFu+Ti+EwhY@ponle.demon.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!diablo.theplanet.net!kibo.news.demon.net!news.demon.co.uk!demon!127.0.0.1!wbriscoeReferences:
<031101c2f721$5ae7d740$3401280a@phx.gbl> <MPG.18f14e951c4c195e9899a0@msnews.microsoft.com> <06c201c2f7d1$7e331e20$2f01280a@phx.gbl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f7a51,1f5b8c13e044a30a X-Google-Attributes: gidf7a51,public X-Google-Thread: fa69e,3b2cdc062b6fbf52,start X-Google-Attributes: gidfa69e,public X-Google-ArrivalTime: 2003-04-01 04:47:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!diablo.theplanet.net!kibo.news.demon.net!news.demon.co.uk!demon!127.0.0.1!wbriscoe From: Walter Briscoe <wbriscoe@ponle.demon.co.uk> Newsgroups: microsoft.public.vc.language,borland.public.cpp.borlandcpp Subject: Compiling a C program with MS Visual Studio 6.0 or Borland C/C++ 5 Date: Tue, 1 Apr 2003 08:28:46 +0100 Lines: 105 Sender: Walter Briscoe <wbriscoe@127.0.0.1> Message-ID: <akChPyFu+Ti+EwhY@ponle.demon.co.uk> References: <031101c2f721$5ae7d740$3401280a@phx.gbl> <MPG.18f14e951c4c195e9899a0@msnews.microsoft.com> <06c201c2f7d1$7e331e20$2f01280a@phx.gbl> NNTP-Posting-Host: ponle.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1049201202 19118 194.222.194.7 (1 Apr 2003 12:46:42 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Tue, 1 Apr 2003 12:46:42 +0000 (UTC) User-Agent: Turnpike/6.02-U (<rq8rxKjVGtMiYN2c4l2LNUa4Mz>)