delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/08/04/18:57:38

Date: Wed, 4 Aug 93 18:07:37 -0400
From: DJ Delorie <dj AT ctron DOT com>
To: pak AT cs DOT ubc DOT ca
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: can't find the library

> I compiled some c codes to object files. Then I create a library
> of these objects and put it in the \djgpp\lib directory. However
> when I compile a new c file and try to use the new library without
> giving its path, the gcc compiler complains not able to find the 
> library. If I type something like "gcc file.c \djgpp\lib\mylib",
> the program works. Why?

This is how it's supposed to work:

	gcc -c myfile.c
	ar rv libme.a myfile.o
	ranlib libme.a
	copy libme.a \djgpp\lib
	gcc -v prog.c -lme -o prog

Is this what you're doing?

Gcc sees -lXX and looks for libXX.a in $LIBRARY_PATH.

DJ


- Raw text -


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