delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/26/15:51:08

Message-ID: <003f01bdd129$b4826270$726f6f6f@c3nt2>
From: "Andrew Deren" <aderen AT interaccess DOT com>
To: "Klaus Petzold" <califax AT wupperonline DOT de>, <djgpp AT delorie DOT com>
Subject: Re: Problem with include-files
Date: Wed, 26 Aug 1998 14:42:33 -0500
MIME-Version: 1.0

>
>I have a problem under DJGPP version 2.7.2.1 when I want to implement
>something like the following:
>
>->filename: test.h
>
>#ifndef _TEST_
>#define _TEST_
>
>int t;

you need to put:
extern int t; 
in the include file
and in either source file:
int t;

>
>#endif
>
>->filename test.cc
>
>#include "test.h"
>
>
>-> filename main.cc
>
>#include "test.h"
>
>int main()
>{
>}
>
>When I link these files I get the following error message:
>-multiple definition of 't'
>What's wrong?
>
>tia...
>  ...Klaus...
>
>

- Raw text -


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