🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #32

consts and double consts

#32
From: m.terribile
Date: Thu, 27 Feb 1986 06:29
24 lines
1353 bytes
I have a .h file with two consts:

	const	a = 10;

	const double	b = 12.5;

The second one gives me a multiply defined symbol from the linker when I
include the .h in two .c's .  The first does not.

It appears that double consts are handled by cfront as initialized variables.
That rules out the usage I have described above.

I tried omitting the ``= 12.5'' but cfront told me that the missing value was
no good.

	How do I get this const declared in a .h for two files when cfront
and the linker seem to insist on working at cross purposes?
-- 

	from Mole End			Mark Terribile
		(scrape .. dig )	mtx5b!mat
					(Please mail to mtx5b!mat, NOT mtx5a!
						mat, or to mtx5a!mtx5b!mat)
    ,..      .,,       ,,,   ..,***_*.
Technical Details
Message-ID: <1219@mtx5a.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akguc!mtunh!mtung!mtunf!mtx5c!mtx5d!mtx5a!mat

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site mtx5a.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!akguc!mtunh!mtung!mtunf!mtx5c!mtx5d!mtx5a!mat
From: mat@mtx5a.UUCP (m.terribile)
Newsgroups: net.lang.c++
Subject: consts and double consts
Message-ID: <1219@mtx5a.UUCP>
Date: Thu, 27-Feb-86 01:29:15 EST
Article-I.D.: mtx5a.1219
Posted: Thu Feb 27 01:29:15 1986
Date-Received: Sat, 1-Mar-86 04:22:12 EST
Distribution: net
Organization: AT&T Information Systems, Middletown, NJ 07748-4801.
Lines: 24