[Issue 3770] New: Associative array with enum key causes link problems when compiled in multiple files
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Feb 4 08:14:16 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3770
Summary: Associative array with enum key causes link problems
when compiled in multiple files
Product: D
Version: 2.040
Platform: x86
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: webmaster at villagersonline.com
--- Comment #0 from Russ Lewis <webmaster at villagersonline.com> 2010-02-04 08:14:14 PST ---
DMD 2.040
Linux (Fedora) on x86
NOTE: I think that this is a likely dup of 3745. However, I'm posting this new
defect because it is a new flavor of the problem, just in case the root causes
are somewhat different.
--file: foo.d--
import std.stdio;
import bar;
void main()
{
foreach(e; ENUM_table.values)
writef("%d", e);
foreach(e; ENUM_table.keys)
writef("%d", e);
}
-------------
--file: bar.d--
enum ENUM : uint {
INVALID = 256
}
int[ENUM] ENUM_table;
-------------
compile:
dmd -c foo.d
dmd -c bar.d
gcc -m32 foo.o bar.o -L ~/d/2.0/dmd2/linux/lib -lphobos2 -lpthread -lm -o
foobar
-------------
error:
foo.o: In function `_Dmain':
foo.d:(.text._Dmain+0x14): undefined reference to
`_D6object35__T16AssociativeArrayTE3bar4ENUMTiZ16AssociativeArray6valuesMFNdZAi'
foo.d:(.text._Dmain+0x70): undefined reference to
`_D6object35__T16AssociativeArrayTE3bar4ENUMTiZ16AssociativeArray4keysMFNdZAE3bar4ENUM'
collect2: ld returned 1 exit status
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list