public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Broken C code
@ 2000-01-27 22:58 Earnie Boyd
  2000-01-27 23:37 ` Stephen Davies
  0 siblings, 1 reply; 11+ messages in thread
From: Earnie Boyd @ 2000-01-27 22:58 UTC (permalink / raw)
  To: Stephen Davies, cygwin

It wouldn't be the \r\n line endings would it?

--- Stephen Davies <scldad@sdc.com.au> wrote:
> Hello.
> 
> I have managed to break my ability to compile a number of C programs with gcc
> 
> 2.7B19 under cygwin B19.1.
> 
> In September 1999, all of these programs compiled successfully on the same 
> machine with the same cygwin environment.
> 
> Now, all of the programs involved fail to compile with the same error
> messages 
> and I haven't a clue as to why.
> 
> In all cases, the following code is included from a vendor-specific set of 
> headers:
> 
> typedef  IDI_ULONG  (__attribute__((__stdcall__))  *  OPI_DELETE_CALLBACK ) 
> (OPI_CONID, OPI_FILEID);^M
> __declspec(dllexport)   IDI_USHORT  __attribute__((__stdcall__))  
> OpiMakeConnection( OPI_PCONID pConID );^M
> 
> (This is just two of many similar lines)
> 
> This produces the following compiler message:
> 
> ../include/opiob.h: In function '__declspec':
> In file included from ../include/opi.h:283,
>                        from cic.h:1,
>                        from getpk.c:1
> ../include/opiob.h:141 parse error before '__declspec'
> ../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no 
> such parameter
> 
> followed by a whole bundle of similar errors.
> 
> Can anyone please explain to me what I have done/not done to cause this 
> misinterpretation of the __declspec(dllexport) syntax?
> 
> Cheers and thanks,
> Stephen Davies
> 
> 
> -- 
> ========================================================================
> Stephen Davies Consulting	    		      scldad@sdc.com.au
> Adelaide, South Australia.     		          Voice: 08-8177 1595
> Computing & Network solutions.	 	      Fax: 08-8177 0133
> 
> 
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 
> 

=====
Earnie Boyd < mailto:earnie_boyd@yahoo.com >
Cygwin Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 22:58 Broken C code Earnie Boyd
@ 2000-01-27 23:37 ` Stephen Davies
  0 siblings, 0 replies; 11+ messages in thread
From: Stephen Davies @ 2000-01-27 23:37 UTC (permalink / raw)
  To: earnie_boyd; +Cc: Stephen Davies, cygwin

G'day Earnie and thanks for your reply.

A couple of people have made this suggestion but it is not relevant.

I do not know whether it is intentional or accidental but gcc (and several 
other tools) seem to handle \n and \r\n as identical. (Even WordPad can do it.)

My problem was that (for reasons as yet unknown) my gcc specs file did not 
include a definition for __declspec.

Cheers,
Stephen.

Earnie Boyd <earnie_boyd@yahoo.com>  wrote:
> It wouldn't be the \r\n line endings would it?
> 
> --- Stephen Davies <scldad@sdc.com.au> wrote:
> > Hello.
> > 
> > I have managed to break my ability to compile a number of C programs with gcc
> > 
> > 2.7B19 under cygwin B19.1.
> > 
> > In September 1999, all of these programs compiled successfully on the same 
> > machine with the same cygwin environment.
> > 
> > Now, all of the programs involved fail to compile with the same error
> > messages 
> > and I haven't a clue as to why.
> > 
> > In all cases, the following code is included from a vendor-specific set of 
> > headers:
> > 
> > typedef  IDI_ULONG  (__attribute__((__stdcall__))  *  OPI_DELETE_CALLBACK ) 
> > (OPI_CONID, OPI_FILEID);^M
> > __declspec(dllexport)   IDI_USHORT  __attribute__((__stdcall__))  
> > OpiMakeConnection( OPI_PCONID pConID );^M
> > 
> > (This is just two of many similar lines)
> > 
> > This produces the following compiler message:
> > 
> > ../include/opiob.h: In function '__declspec':
> > In file included from ../include/opi.h:283,
> >                        from cic.h:1,
> >                        from getpk.c:1
> > ../include/opiob.h:141 parse error before '__declspec'
> > ../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no 
> > such parameter
> > 
> > followed by a whole bundle of similar errors.
> > 
> > Can anyone please explain to me what I have done/not done to cause this 
> > misinterpretation of the __declspec(dllexport) syntax?
> > 
> > Cheers and thanks,
> > Stephen Davies
> > 
> > 
> > -- 
> > ========================================================================
> > Stephen Davies Consulting	    		      scldad@sdc.com.au
> > Adelaide, South Australia.     		          Voice: 08-8177 1595
> > Computing & Network solutions.	 	      Fax: 08-8177 0133
> > 
> > 
> > 
> > --
> > Want to unsubscribe from this list?
> > Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> > 
> > 
> 
> =====
> Earnie Boyd < mailto:earnie_boyd@yahoo.com >
> Cygwin Newbies, please visit
> < http://www.freeyellow.com/members5/gw32/index.html >
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com



-- 
========================================================================
Stephen Davies Consulting	    		      scldad@sdc.com.au
Adelaide, South Australia.     		          Voice: 08-8177 1595
Computing & Network solutions.	 	      Fax: 08-8177 0133



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 22:19   ` Stephen Davies
  2000-01-28 13:58     ` Chris Faylor
@ 2000-01-29 11:44     ` Mumit Khan
  1 sibling, 0 replies; 11+ messages in thread
From: Mumit Khan @ 2000-01-29 11:44 UTC (permalink / raw)
  To: Stephen Davies; +Cc: cygwin

On Fri, 28 Jan 2000, Stephen Davies wrote:

> OK. That does solve the problem:-))
> 
> My specs file looked OK but did not include the declspec define. Adding it in 
> got me going again.
> 
> At least, it gets me to the point where I can compile and run the executable.
> 
> It is not the complete answer though. I still get several hundred:
> 
> warning: 'dllexport' attribute directive ignored
> 
> messages.
> 
> Also, it does not explain what happened to break my setup.
> 
> Is this declspec definition in specs new?

Newer than gcc-2.7b9 or whatever it is you're using.

> 
> What is it for?
> 

It's for using and building DLLs.

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 18:54 Stephen Davies
  2000-01-27 19:15 ` Chris Faylor
  2000-01-27 20:20 ` Terry Lincoln
@ 2000-01-29 11:34 ` Mumit Khan
  2 siblings, 0 replies; 11+ messages in thread
From: Mumit Khan @ 2000-01-29 11:34 UTC (permalink / raw)
  To: Stephen Davies; +Cc: cygwin

On Fri, 28 Jan 2000, Stephen Davies wrote:

> I have managed to break my ability to compile a number of C programs with gcc 
> 2.7B19 under cygwin B19.1.

gcc-2.7B19 is really really old ;-)

The dllimport/dllexport support wasn't in gcc until egcs-1.1 release or
so, and until you upgrade, you're out of luck. Sorry.

I don't know how any code using __declspec/__attribute__(dllimport/export)
worked for you using this version of gcc.

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 22:19   ` Stephen Davies
@ 2000-01-28 13:58     ` Chris Faylor
  2000-01-29 11:44     ` Mumit Khan
  1 sibling, 0 replies; 11+ messages in thread
From: Chris Faylor @ 2000-01-28 13:58 UTC (permalink / raw)
  To: Stephen Davies; +Cc: cygwin

On Fri, Jan 28, 2000 at 04:49:04PM +1030, Stephen Davies wrote:
>OK. That does solve the problem:-))
>
>My specs file looked OK but did not include the declspec define. Adding it in 
>got me going again.
>
>At least, it gets me to the point where I can compile and run the executable.
>
>It is not the complete answer though. I still get several hundred:
>
>warning: 'dllexport' attribute directive ignored
>
>messages.
>
>Also, it does not explain what happened to break my setup.
>
>Is this declspec definition in specs new?
>
>What is it for?

It may be new.  I don't remember how it used to be done.  Possibly it was just
compiled into gcc.

>Thanks again Chris,

I don't think I really solved your problem.  In fact, I may have just complicated
things with my suggestion.  I just don't remember what that version of the compiler
was like.

If gcc is choking on the __attribute__(dllexport) then my suggestion is probably
wrong.  Sorry.

Have you tried doing a compile with "gcc -v" and verifying that all of the paths
are as you'd expect?

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
@ 2000-01-28  5:40 N8TM
  0 siblings, 0 replies; 11+ messages in thread
From: N8TM @ 2000-01-28  5:40 UTC (permalink / raw)
  To: scldad, earnie_boyd; +Cc: cygwin

In a message dated 1/27/2000 11:39:05 PM Pacific Standard Time, 
scldad@sdc.com.au writes:

> gcc (and several 
>  other tools) seem to handle \n and \r\n as identical.

makeinfo (cwilson revision) chokes on the mixture of \n and \r\n in the 
gcc-2.96 snapshots.  gcc-2.95.2 .texi files are clean, no \r.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 19:15 ` Chris Faylor
  2000-01-27 21:22   ` Stephen Davies
@ 2000-01-27 22:19   ` Stephen Davies
  2000-01-28 13:58     ` Chris Faylor
  2000-01-29 11:44     ` Mumit Khan
  1 sibling, 2 replies; 11+ messages in thread
From: Stephen Davies @ 2000-01-27 22:19 UTC (permalink / raw)
  To: cygwin

OK. That does solve the problem:-))

My specs file looked OK but did not include the declspec define. Adding it in 
got me going again.

At least, it gets me to the point where I can compile and run the executable.

It is not the complete answer though. I still get several hundred:

warning: 'dllexport' attribute directive ignored

messages.

Also, it does not explain what happened to break my setup.

Is this declspec definition in specs new?

What is it for?

Thanks again Chris,

Stephen

> Chris Faylor <cgf@cygnus.com>  wrote:
> On Fri, Jan 28, 2000 at 01:23:44PM +1030, Stephen Davies wrote:
> >This produces the following compiler message:
> >
> >../include/opiob.h: In function '__declspec':
> >In file included from ../include/opi.h:283,
> >                       from cic.h:1,
> >                       from getpk.c:1
> >../include/opiob.h:141 parse error before '__declspec'
> >../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no 
> >such parameter
> >
> >followed by a whole bundle of similar errors.
> >
> >Can anyone please explain to me what I have done/not done to cause this 
> >misinterpretation of the __declspec(dllexport) syntax?
> 
> It sounds like your specs file is screwed up.  It should be in something
> like .../lib/gcc-lib/cygnus-2.7b19/specs but I don't know precisely where
> it would be located.
> 
> It should contain a line like this:
> 
> *predefines:
> -Di386 -D_WIN32   -DWINNT  -D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))   -D__cdecl=__attribute__((__cdecl__))   -D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) -Amachine(i386)
> 
> This is from a much more recent gcc compiler so this may not be exactly right
> but you can at least see what it should look like.
> 
> It's possible that you also may have something like a GCC_LIBRARY environment
> variable which is pointing to the wrong place.
> 
> cgf



-- 
========================================================================
Stephen Davies Consulting	    		      scldad@sdc.com.au
Adelaide, South Australia.     		          Voice: 08-8177 1595
Computing & Network solutions.	 	      Fax: 08-8177 0133



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 19:15 ` Chris Faylor
@ 2000-01-27 21:22   ` Stephen Davies
  2000-01-27 22:19   ` Stephen Davies
  1 sibling, 0 replies; 11+ messages in thread
From: Stephen Davies @ 2000-01-27 21:22 UTC (permalink / raw)
  To: cygwin

G'day Chris and thank you for your reply.

I haven't had a chance to check yet but your suggestion sounds very promising.

I'll let you know how I go.

Cheers and thanks,
Stephen.

Chris Faylor <cgf@cygnus.com>  wrote:

> It sounds like your specs file is screwed up.  It should be in something
> like .../lib/gcc-lib/cygnus-2.7b19/specs but I don't know precisely where
> it would be located.
> 
> It should contain a line like this:
> 
> *predefines:
> -Di386 -D_WIN32   -DWINNT  -D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))   -D__cdecl=__attribute__((__cdecl__))   -D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) -Amachine(i386)
> 
> This is from a much more recent gcc compiler so this may not be exactly right
> but you can at least see what it should look like.
> 
> It's possible that you also may have something like a GCC_LIBRARY environment
> variable which is pointing to the wrong place.
> 
> cgf



-- 
========================================================================
Stephen Davies Consulting	    		      scldad@sdc.com.au
Adelaide, South Australia.     		          Voice: 08-8177 1595
Computing & Network solutions.	 	      Fax: 08-8177 0133



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 18:54 Stephen Davies
  2000-01-27 19:15 ` Chris Faylor
@ 2000-01-27 20:20 ` Terry Lincoln
  2000-01-29 11:34 ` Mumit Khan
  2 siblings, 0 replies; 11+ messages in thread
From: Terry Lincoln @ 2000-01-27 20:20 UTC (permalink / raw)
  To: Stephen Davies; +Cc: cygwin

Stephen Davies wrote:

> Hello.
>
> I have managed to break my ability to compile a number of C programs with gcc
> 2.7B19 under cygwin B19.1.
>
> In September 1999, all of these programs compiled successfully on the same
> machine with the same cygwin environment.
>
> Now, all of the programs involved fail to compile with the same error messages
> and I haven't a clue as to why.
>
> In all cases, the following code is included from a vendor-specific set of
> headers:
>
> typedef  IDI_ULONG  (__attribute__((__stdcall__))  *  OPI_DELETE_CALLBACK )  (OPI_CONID, OPI_FILEID);^M
> __declspec(dllexport)   IDI_USHORT  __attribute__((__stdcall__))   OpiMakeConnection( OPI_PCONID pConID );^M
>
> (This is just two of many similar lines)
>
> This produces the following compiler message:
>
> ../include/opiob.h: In function '__declspec':
> In file included from ../include/opi.h:283,
>                        from cic.h:1,
>                        from getpk.c:1
> ../include/opiob.h:141 parse error before '__declspec'
> ../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no
> such parameter
>
> followed by a whole bundle of similar errors.
>
> Can anyone please explain to me what I have done/not done to cause this
> misinterpretation of the __declspec(dllexport) syntax?
>
> Cheers and thanks,
> Stephen Davies
>
> --
> ========================================================================
> Stephen Davies Consulting                             scldad@sdc.com.au
> Adelaide, South Australia.                        Voice: 08-8177 1595
> Computing & Network solutions.                Fax: 08-8177 0133
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com

  I believe you have a text-mode vs. binary-mode problem.  Your files have
^M^J at end of each line but only ^J is needed by the compiler this leaves
an invalid ^M character at the beginning of lines which the compiler can't
parse.
  I suggest you have mounted the source drive in binary mode and you should
mount in in text mode instead.

Warm Regards,

Terry Lincoln


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Broken C code
  2000-01-27 18:54 Stephen Davies
@ 2000-01-27 19:15 ` Chris Faylor
  2000-01-27 21:22   ` Stephen Davies
  2000-01-27 22:19   ` Stephen Davies
  2000-01-27 20:20 ` Terry Lincoln
  2000-01-29 11:34 ` Mumit Khan
  2 siblings, 2 replies; 11+ messages in thread
From: Chris Faylor @ 2000-01-27 19:15 UTC (permalink / raw)
  To: Stephen Davies; +Cc: cygwin

On Fri, Jan 28, 2000 at 01:23:44PM +1030, Stephen Davies wrote:
>This produces the following compiler message:
>
>../include/opiob.h: In function '__declspec':
>In file included from ../include/opi.h:283,
>                       from cic.h:1,
>                       from getpk.c:1
>../include/opiob.h:141 parse error before '__declspec'
>../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no 
>such parameter
>
>followed by a whole bundle of similar errors.
>
>Can anyone please explain to me what I have done/not done to cause this 
>misinterpretation of the __declspec(dllexport) syntax?

It sounds like your specs file is screwed up.  It should be in something
like .../lib/gcc-lib/cygnus-2.7b19/specs but I don't know precisely where
it would be located.

It should contain a line like this:

*predefines:
-Di386 -D_WIN32   -DWINNT  -D_X86_=1 -D__STDC__=1  -D__stdcall=__attribute__((__stdcall__))   -D__cdecl=__attribute__((__cdecl__))   -D__declspec(x)=__attribute__((x))   -Asystem(winnt) -Acpu(i386) -Amachine(i386)

This is from a much more recent gcc compiler so this may not be exactly right
but you can at least see what it should look like.

It's possible that you also may have something like a GCC_LIBRARY environment
variable which is pointing to the wrong place.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Broken C code
@ 2000-01-27 18:54 Stephen Davies
  2000-01-27 19:15 ` Chris Faylor
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stephen Davies @ 2000-01-27 18:54 UTC (permalink / raw)
  To: cygwin

Hello.

I have managed to break my ability to compile a number of C programs with gcc 
2.7B19 under cygwin B19.1.

In September 1999, all of these programs compiled successfully on the same 
machine with the same cygwin environment.

Now, all of the programs involved fail to compile with the same error messages 
and I haven't a clue as to why.

In all cases, the following code is included from a vendor-specific set of 
headers:

typedef  IDI_ULONG  (__attribute__((__stdcall__))  *  OPI_DELETE_CALLBACK )  (OPI_CONID, OPI_FILEID);^M
__declspec(dllexport)   IDI_USHORT  __attribute__((__stdcall__))   OpiMakeConnection( OPI_PCONID pConID );^M

(This is just two of many similar lines)

This produces the following compiler message:

../include/opiob.h: In function '__declspec':
In file included from ../include/opi.h:283,
                       from cic.h:1,
                       from getpk.c:1
../include/opiob.h:141 parse error before '__declspec'
../include/opiob.h:140 declaration for parameter 'OpiMakeConnection' but no 
such parameter

followed by a whole bundle of similar errors.

Can anyone please explain to me what I have done/not done to cause this 
misinterpretation of the __declspec(dllexport) syntax?

Cheers and thanks,
Stephen Davies


-- 
========================================================================
Stephen Davies Consulting	    		      scldad@sdc.com.au
Adelaide, South Australia.     		          Voice: 08-8177 1595
Computing & Network solutions.	 	      Fax: 08-8177 0133



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2000-01-29 11:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-27 22:58 Broken C code Earnie Boyd
2000-01-27 23:37 ` Stephen Davies
  -- strict thread matches above, loose matches on Subject: below --
2000-01-28  5:40 N8TM
2000-01-27 18:54 Stephen Davies
2000-01-27 19:15 ` Chris Faylor
2000-01-27 21:22   ` Stephen Davies
2000-01-27 22:19   ` Stephen Davies
2000-01-28 13:58     ` Chris Faylor
2000-01-29 11:44     ` Mumit Khan
2000-01-27 20:20 ` Terry Lincoln
2000-01-29 11:34 ` Mumit Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).