delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/04/01/00:29:17

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Andris Pavenis <pavenis AT latnet DOT lv>
To: djgpp AT delorie DOT com
Subject: Re: Problem with Allegro and DzComm
Date: Thu, 1 Apr 2004 08:25:26 +0300
User-Agent: KMail/1.6.1
References: <c4e9db$228g$1 AT alpha2 DOT radio-msu DOT net>
In-Reply-To: <c4e9db$228g$1@alpha2.radio-msu.net>
MIME-Version: 1.0
Message-Id: <200404010825.27593.pavenis@latnet.lv>
Reply-To: djgpp AT delorie DOT com

On Wednesday 31 March 2004 14:17, Anthony wrote:
> Hello!
> I'm experiencing problems with Allegro 4.1.12 + DzComm 0.9.9g programming.
>
> Also I have a small test program that uses dzcomm with no allegro. While it
> is a single file, it works fine. If I split it into two files, I'm not able
> to link it:
>
> in file c306th.h:
> #ifndef _CENTER_306_THERMOMETR_H_
> #define _CENTER_306_THERMOMETR_H_
>
> #include <stdexcept>
> #include <dzcomm.h>
> ...
> #endif
>
> in file c306th.cpp:
> #include "C306th.h"
> ...
>
> in file thermo.cpp:
> #include <iostream>
> #include <iomanip>
> #include "C306th.h"
> ...
>
> Then
> C:\DJGPP\MyProjects\Thermo>gpp -Wall C306th.cpp thermo.cpp -o
> thermo.exe -ldzcom
>
> c:/djgpp/tmp/ccId1w5b.o(.text+0x0):thermo.cpp: multiple definition of
> `__dzdos_i
> nstall_irq'
> c:/djgpp/tmp/cctwBPwX.o(.text+0x0):C306th.cpp: first defined here
> c:/djgpp/tmp/ccId1w5b.o(.text+0x1a):thermo.cpp: multiple definition of

It's in DZCOMM documentation (it was not read carefully enough):
--------------------  fragment from documentation ----------
To use dzcomm in your code you will need to put 


      #include <dzcomm.h>


in your code. Obviously (I hope) this will only work after you've installed 
the library. If you wish to use allegro alongside dzcomm you will need to 
include the allegro library. If you do so it is IMPERATIVE that you include 
allegro first (this how dzcomm knows where to link to): 

      #include <allegro.h>
      #include <dzcomm.h>



 If you have more than one C file in a project and you wish to access dzcomm 
from more than one of those files, you must put the following #define before 
all but one of the dzcomm includes: 

      #define DZCOMM_SECONDARY_INCLUDE
      #include <dzcomm.h>


However, do remember to inlcude it once without the #define! 
-------------------------------------------------------------------------------

Andris

- Raw text -


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