Mail Archives: djgpp/2004/04/01/00:29:17
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 -