delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/01/16/05:29:41

X-Spam-Check-By: sourceware.org
Date: Tue, 16 Jan 2007 11:29:18 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: struct passwd problem : running on XP
Message-ID: <20070116102918.GD28312@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <loom DOT 20070116T095321-153 AT post DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <loom.20070116T095321-153@post.gmane.org>
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Jan 16 08:53, DEMARCHE wrote:
> Here is the history ; Gcc compiled correctly my program with default options.
> "gcc -c mqutils.c ".
> I wanted to have my program independant of the Cygwin environment using -mno-
> cygwin option. "gcc -mno-cygwin -c mqutils.c ". My aim was to deploy my program 
> onto Windows Operating system wihtout cygwin installed.
> 
> Here is the result :
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> gcc -mno-cygwin -g -I. -I"/cygdrive/c/Program Files/IBM/WebSphere 
> MQ/Tools/c/include"  -c mqutils.c
> In file included from mqutils.c:34:
> /usr/include/pwd.h:53: error: parse error before "uid_t"
> /usr/include/pwd.h:53: warning: no semicolon at end of struct or union
> /usr/include/pwd.h:54: warning: data definition has no type or storage class
> /usr/include/pwd.h:59: error: parse error before '}' token
> /usr/include/pwd.h:62: warning: parameter names (without types) in function 
> declaration
> /usr/include/pwd.h:66: error: parse error before "struct"
> mqutils.c: In function `PutMsg':
> mqutils.c:106: error: dereferencing pointer to incomplete type
> make: *** [mqutils.o] Error 1
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> 
> Here is my program :
> line 100 if(strlen(userId) == 0) {
> line 101         struct passwd *pwd;
> line 102
> line 103         memset(userId, 0, sizeof(userId));
> line 104         pwd = getpwuid(getuid());
> line 105         if(pwd)
> line 106                 strcpy(userId, pwd->pw_name);
> line 107                 }
> line 108
> 
> 
> I hope these information will help you.

Your header files seem to be broken.  The above error is generated
because it can't find the definition for uid_t which is available in
cygwin/types.h, which is included automatically by pwd.h through
including sys/type.h.  Somehow your header files are mixed up.
gcc -E might be helpful.  Do you have a fresh Cygwin install?


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019