www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/29/01:02:10

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Beginner: C / Allegro: "-lalleg"
Date: Sun, 28 Dec 1997 17:15:44 -0500
Organization: Two pounds of chaos and a pinch of salt.
Lines: 37
Message-ID: <34A6CF90.8AA@cs.com>
References: <34a65d39 DOT 1813898 AT news2 DOT frankfurt DOT netsurf DOT de>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp210.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Bjoern Appel wrote:
> 
> When I want to compile a Allegro-Program, lets say the example, I have
> to type:
> 
> gcc ex1.c -o ex1.exe -lalleg    <-'
> 
> No, I don't have any problems with it, everything works fine. But can
> someone explain me, why I have to use the "lalleg" ? Why is it not
> enough to have the "#include<allegro.h>" in the source-file, compared
> to Pascal's "Uses Crt,..." ?

There is a difference in C between header files and libraries.  Header
files contain declarations for library code, while the libraries contain
the actual code.  The linker (ld) has no way to know what libraries
contain what code, so you must tell it when you compile your programs.

> And something about RHIDE:
> In RHIDE I have to change "Options -> Libraries" every time I start
> the IDE and want to compile an Allegro-Program. Is there any way to
> save the changes I made ?

You can create a "default" RHIDE configuration by saving your
configuration as 'rhide.gpr' in the same directory as 'rhide.exe'
(usually your DJGPP bin directory).  RHIDE will load the settings from
this project file by default each time it starts up.  Similarly, you
could select your default Allegro settings, save them in a project file,
and then instruct RHIDE to load this file each time it starts.

hth

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |     mailto:fighteer AT cs DOT com      |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


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