www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/24/19:04:27

From: oliver AT jesus DOT hv (Oliver Richman)
Newsgroups: comp.os.msdos.djgpp,comp.lang.c++
Subject: Re: Problems defining external symbols in C++ !?
Date: Mon, 24 Aug 1998 00:50:45 GMT
Organization: Pathway Communications
Message-ID: <35e0a4fd.7817838@news.pathcom.com>
References: <35dcd766 DOT 101916239 AT news DOT pathcom DOT com> <35DDCDF2 DOT 9F445A4A AT unb DOT ca>
NNTP-Posting-Host: ts9l1.pathcom.com
Lines: 23
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 21 Aug 1998 16:43:49 -0300, Endlisnis <s257m AT unb DOT ca> wrote:

>Oliver Richman wrote:
>
>> from moo.cc:
>> const struct moostruct moovariable[] = { ... }
>>
>> from moo2.cc:
>> extern const struct moostruct moovariable[];
>>
>> I get an "undefined reference to moovariable" in moo2.cc.
>
>    I tried compiling that, and it didn't work for me either.  You can't have
>extern const data.  I don't know why, but if you remove the 'const' it will work.

So there you have it. I wonder if it would work under another
compiler? As it turns out, I really want this data structure to be
const, but I guess you can't have everything. :)

-opr-
--                                   \ Two FREE games on my homepage, and more!
orichman at hotmail.com                \ 1. NETWHACK (C++ port of NetHack)
www.pathcom.com/~simex/opr/index.html   \ 2. DOS ROGUE 1.0 (1.1 coming soon!)

- Raw text -


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