From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: how do I find Date: Tue, 17 Dec 1996 19:22:48 -0800 Organization: Two pounds of chaos and a pinch of salt Lines: 58 Message-ID: <32B76388.6779@cs.com> References: <595g4v$g8g AT nntp DOT novia DOT net> Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp213.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Alaric Dailey DJ-Gateway: from newsgroup comp.os.msdos.djgpp Alaric Dailey wrote: > > I have two libraries and a few header files that I would like to put into > \djgpp\include and \djgpp\lib however when I try to compile it doesn't > find them. I am trying this in C and their nothing reall spectacular but I > would like to relocate them somewhere out of my way, how can I tell Djgpp > to look in these directories for these files. It seems to me that it > should look in these directories anyways! It is not generally a good idea to put custom libraries and headers into the main compiler directories, simply because they can easily get forgotten about, overwritten, or confused with standard files. If you have created special libraries for your programs, it is usually better to put them in a special directory and use the -L and -I directives on the command line to gcc to specify where they are. This also makes it much easier to distribute your programs. That said, if you did put the files into the DJGPP directories and it isn't finding them, you've probably done something wrong when trying to include/link them. Please post some sample code that shows how you are trying to link or include the files, and we will be able to help you better. A listing of the output of gcc, as described in the FAQ section 6.12, will help even more. Some ideas: - The files aren't named according to POSIX conventions. All header files must end with '.h', and all libraries must begin with 'lib' and end with '.a'. Borland-style '.lib' libraries are NOT compatible with DJGPP. - For headers, you are trying to #include them wrong; i.e., specifying an absolute pathname in the directive, or using wrong capitalization, or using "" instead of <>. - You aren't using the right command line syntax to link the libraries. For a library in the format libXXXX.a, you use '-lXXXX' to link it. Any other way will fail. Capitalization is important. - You must put the '-l' directive at the _end_ of the command line. ld is a one-pass linker, so if the libraries are placed before the object files, you'll get unresolved externals. - You have edited DJGPP.ENV in such a way as to invalidate the C_INCLUDE_PATH or LIBRARY_PATH variables. - You are mixing DJGPP v2.00 and v2.01 programs in such a way as to cause the long command line incompatibility to manifest. (Solution: upgrade completely to v2.01) Hope this helps! -- --------------------------------------------------------------------- | John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com | | Proud owner of what might one | http://www.cs.com/fighteer | | day be a spectacular MUD... | Plan: To make Bill Gates suffer | ---------------------------------------------------------------------