delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/08/10:25:24

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Tue, 8 Aug 2000 10:24:03 -0400
To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>,
"'cygwin-subscribe AT sourceware DOT cygnus DOT com'" <cygwin-subscribe AT sourceware DOT cygnus DOT com>,
"'cygwin-info AT sourceware DOT cygnus DOT com'" <cygwin-info AT sourceware DOT cygnus DOT com>,
"'cygwin-faq AT sourceware DOT cygnus DOT com'" <cygwin-faq AT sourceware DOT cygnus DOT com>,
"'cygwin-digest-subscribe AT sourceware DOT cygnus DOT com'" <cygwin-digest-subscribe AT sourceware DOT cygnus DOT com>
Subject: Re: FW: Psapi.dll/lib problem
Message-ID: <20000808102403.F20147@cygnus.com>
Reply-To: cygwin AT sources DOT redhat DOT com
Mail-Followup-To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>,
"'cygwin-subscribe AT sourceware DOT cygnus DOT com'" <cygwin-subscribe AT sourceware DOT cygnus DOT com>,
"'cygwin-info AT sourceware DOT cygnus DOT com'" <cygwin-info AT sourceware DOT cygnus DOT com>,
"'cygwin-faq AT sourceware DOT cygnus DOT com'" <cygwin-faq AT sourceware DOT cygnus DOT com>,
"'cygwin-digest-subscribe AT sourceware DOT cygnus DOT com'" <cygwin-digest-subscribe AT sourceware DOT cygnus DOT com>
References: <39C5845092F9D1119AA90008C724FC7C020665DC AT prowler DOT ideas DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.6i
In-Reply-To: <39C5845092F9D1119AA90008C724FC7C020665DC@prowler.ideas.com>; from DARRICK.ADDISON@saic.com on Tue, Aug 08, 2000 at 08:44:01AM -0400

On Tue, Aug 08, 2000 at 08:44:01AM -0400, Addison, Darrick wrote:
>I recently downloaded cygwin and installed it on a Win NT 4.0 workstation
>I'm currently in the process of porting a Linux application to the Windows
>NT platform. The Linux code seems to compile and link with only a few
>changes
>to the source however when I try to make a few Win API calls from the ported
>code I experience the problems listed below.
>
>1.) The code compiles okay but when I attempt to link I receive the
>following error messages
>     using the below makefile:
>
>	# Makefile to build pinf program
># --- macros
>
>CC = gcc
>CFLAGS=	-I /usr/local/include -g 
>OBJECTS=pinf.o hash.o path.o argenv.o 
>LIBS = -L/usr/local/lib/psapi.a  
>
># --- targets
>all:	pinf
>	@echo "Successufully compiled!"
>
>pinf:	$(OBJECTS)
>	$(CC) -o pinf $(OBJECTS) $(LIBS)
>
>pinf.o:	/usr/local/include/psapi.h 
>	$(CC) $(CFLAGS) -c pinf.c hash.c argenv.c path.c
>
>hash.o: /usr/local/include/hash.h /usr/local/include/stdtypes.h
>	$(CC) $(CFLAGS) -c hash.c
>
>path.o: /usr/local/include/ptlist.h /usr/local/include/path.h
>	$(CC) $(CFLAGS) -c path.c
>
>argenv.o: /usr/local/include/argenv.h /usr/local/include/ptlist.h
>	$(CC) $(CFLAGS) -c argenv.c
> 
># --- remove binary and executable files
>clean:
>	rm -f pinf $(OBJECTS)
>
>Linking Error message:
>make
>gcc -I /usr/local/include -g -c pinf.c hash.c argenv.c path.c
>gcc -o pinf pinf.o hash.o path.o argenv.o -L/usr/local/lib/psapi.a
>pinf.o: In function 'main':
>/cygdrive/c/backup/pinf.c:135 undefined reference to 'EnumProcesses'
>pinf.o: In function 'PrintProcessNameAndID':
>/cygdrive/c/backup/pinf.c:467: undefined reference to 'EnumProcessModules'
>/cygdrive/c/backup/pinf.c:470: undefined reference to 'GetModuleBaseName AT 16'
>/cygdrive/c/backup/pinf.c:472: undefined reference to
>'GetModuleFileNameExA AT 16'
>collect2: ld returned 1 exit status
>make: *** [pinf] Error 1
>
>Any suggestions,

Yes.  You need to investigate the -L option a little further.  You're using
it wrong.

-L takes a directory which contains a library to search.  You don't need it.

You really just need this: -lpsapi

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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