public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* problem compile with gcc
@ 2008-10-20  8:06 bjoe
  2008-10-20 10:06 ` Brian Dessent
  0 siblings, 1 reply; 5+ messages in thread
From: bjoe @ 2008-10-20  8:06 UTC (permalink / raw)
  To: cygwin

Dear Sir,
When I try to compile C source with Cygwin I get this error (the
source code originally write with borland) 

$ gcc -mno-cygwin test.c
In file included from
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/security.h:38,
                 from test.c:54:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/sspi.h:60: error: parse error before "SECURITY_STRING"
In file included from /usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/security.h:39,
                 from test.c:54:
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:123: error: parse error before "SECURITY_STRING"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:125: error: parse error before "LogonServer"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:127: error: parse error before '}' token
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:212: error: parse error before "SECPKG_NAME_TYPE"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:225: error: parse error before "SECPKG_NAME_TYPE"
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/ntsecpkg.h:342: error: parse error before "PSecurityUserData"
In file included from test.c:59:
test.h:30:3: warning: no newline at end of file
In file included from test.c:60:
psutils.h:47:66: warning: no newline at end of file
In file included from parser.h:22,
                 from test.c:61:
pcre.h:37:7: warning: no newline at end of file
test.c: In function `ExecuteInfo':
test.c:445: error: `MEMORYSTATUSEX' undeclared (first use in this function)
test.c:445: error: (Each undeclared identifier is reported only once
test.c:445: error: for each function it appears in.)
test.c:445: error: parse error before "sMSE"
test.c:482: error: `sMSE' undeclared (first use in this function)
test.c:495: error: `ComputerNameMax' undeclared (first use in this function)
test.c:498: error: `COMPUTER_NAME_FORMAT' undeclared (first use in this function)
test.c:498: error: parse error before "iCnf"
test.c:510: error: `NameFullyQualifiedDN' undeclared (first use in this function)
test.c:515: error: `NameSamCompatible' undeclared (first use in this function)
test.c:520: error: `NameUserPrincipal' undeclared (first use in this function)

The thing that confusing me is the error came from w32api packages,
not from source code. Maybe someone in this list can explain to me
about what going on here.

Regard
-- 
It is easy to say no when
          there is a deeper yes burning within

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: problem compile with gcc
  2008-10-20  8:06 problem compile with gcc bjoe
@ 2008-10-20 10:06 ` Brian Dessent
  2008-10-24 10:24   ` bjoe
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Dessent @ 2008-10-20 10:06 UTC (permalink / raw)
  To: cygwin

bjoe wrote:

> The thing that confusing me is the error came from w32api packages,
> not from source code. Maybe someone in this list can explain to me
> about what going on here.

You haven't provided enough information, such as what version of w32api
you're using.  If you aren't using the latest (3.12-1), first upgrade
and see if the issue is fixed.

If that doesn't help then we need to see the code, or a standalone
testcase that reproduces the problem.  It could be an #include problem,
for example #including a header that is not meant to be included
directly -- the MSDN page for each API function tells you which header
to include to use that function.  And many windows headers require
<windows.h> to be included first.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: problem compile with gcc
  2008-10-20 10:06 ` Brian Dessent
@ 2008-10-24 10:24   ` bjoe
  2008-10-24 12:03     ` Dave Korn
  0 siblings, 1 reply; 5+ messages in thread
From: bjoe @ 2008-10-24 10:24 UTC (permalink / raw)
  To: cygwin

On Mon, Oct 20, 2008 at 03:05:48AM -0700, Brian Dessent wrote:
> bjoe wrote:
> 
> > The thing that confusing me is the error came from w32api packages,
> > not from source code. Maybe someone in this list can explain to me
> > about what going on here.
> 
> You haven't provided enough information, such as what version of w32api
> you're using.  If you aren't using the latest (3.12-1), first upgrade
> and see if the issue is fixed.
>
$cygcheck -c w32api
 
Cygwin Package Information
Package              Version        Status
w32api               3.12-1         OK
> If that doesn't help then we need to see the code, or a standalone
> testcase that reproduces the problem.  
$cat test.c
 
#include <windows.h>
#include <stdio.h>
#include <stdarg.h>
#include <tchar.h>
#include <security.h>
#include <secext.h>
#include <sys/stat.h>
#include <math.h>


main()
{
return 0;

}

$gcc test.c

test.c:4:19: tchar.h: No such file or directory
In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/security.h:38,
                 from test.c:5:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/sspi.h:60: error: parse error before "SECURITY_STRING"
In file included from /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/security.h:39,
                 from test.c:5:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:123: error: parse error before "SECURITY_STRING"
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:125: error: parse error before "LogonServer"
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:127: error: parse error before '}' token
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:212: error: parse error before "SECPKG_NAME_TYPE"
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:225: error: parse error before "SECPKG_NAME_TYPE"
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/ntsecpkg.h:342: error: parse error before "PSecurityUserData"

> It could be an #include problem,
> for example #including a header that is not meant to be included
> directly -- the MSDN page for each API function tells you which header
> to include to use that function.  And many windows headers require
> <windows.h> to be included first.
Agree, I will try to find in msdn page
>
> Brian
Thank brian


Regards
-- 
It is easy to say no when
          there is a deeper yes burning within

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* RE: problem compile with gcc
  2008-10-24 10:24   ` bjoe
@ 2008-10-24 12:03     ` Dave Korn
  2008-10-30 22:28       ` bjoe
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Korn @ 2008-10-24 12:03 UTC (permalink / raw)
  To: cygwin

bjoe wrote on 24 October 2008 11:24:

> #include <tchar.h>
  ^^^^^^^^^^^^^^^^^ 
  Remove this.  It isn't supported on cygwin, although it is when doing a
mingw cross-compile ('-mno-cygwin').


> #include <security.h>
  ^^^^^^^^^^^^^^^^^^^^^
  Missing header dependency; needs "#include <ntsecapi.h>" before this line.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

* Re: problem compile with gcc
  2008-10-24 12:03     ` Dave Korn
@ 2008-10-30 22:28       ` bjoe
  0 siblings, 0 replies; 5+ messages in thread
From: bjoe @ 2008-10-30 22:28 UTC (permalink / raw)
  To: cygwin

Dear Dave,

Thank to this quick answer, I finally able to resolve this problem by
including ntdef.h. But with your solution I can compile it in native
cygwin without -mno-cygwin.


Regards,

On Fri, Oct 24, 2008 at 01:03:14PM +0100, Dave Korn wrote:
> bjoe wrote on 24 October 2008 11:24:
> 
> > #include <tchar.h>
>   ^^^^^^^^^^^^^^^^^ 
>   Remove this.  It isn't supported on cygwin, although it is when doing a
> mingw cross-compile ('-mno-cygwin').
> 
> 
> > #include <security.h>
>   ^^^^^^^^^^^^^^^^^^^^^
>   Missing header dependency; needs "#include <ntsecapi.h>" before this line.
> 
> 
>     cheers,
>       DaveK
> -- 
> Can't think of a witty .sigline today....
> 

-- 
It is easy to say no when
          there is a deeper yes burning within

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

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

end of thread, other threads:[~2008-10-30 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-20  8:06 problem compile with gcc bjoe
2008-10-20 10:06 ` Brian Dessent
2008-10-24 10:24   ` bjoe
2008-10-24 12:03     ` Dave Korn
2008-10-30 22:28       ` bjoe

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).