| Thread overview | |||||
|---|---|---|---|---|---|
|
October 19, 2006 Problem on importing own modules. | ||||
|---|---|---|---|---|
| ||||
Hi.
I'm a newbie for D, so I can't tell where is the error.
I have two modules, one named "telnet" and one named "element". I import
"telnet" into "element":
[code]
static public import telnet;
[/code]
In module "element" I define a class and a few functions like these ones:
[code]
public class oElement
{ ... }
char[] gotoxy(int x, int y)
{ ... }
char[] highlight(int on = 1)
{ ... }
[/code]
I've tested the module (as a program) and it worked fine (using module
"telnet" also).
Then I wanted to import "element" in a new (future) module:
[code]
public import element;
[/code]
If I don't use anything from "element" in main() it works fine. But when I
want to create an instance of oElement using new the compiler fails:
[message]
Error 42: Symbol Undefined __Class_7element8oElement
[/message]
What do I do wrong?
Thanks for your help.
| ||||
October 19, 2006 Re: Problem on importing own modules. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Nahon | compile with dmd telnet element //and switches or use build (or bud) build telnet // and switches | |||
October 19, 2006 Re: Problem on importing own modules. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Tiberiu Gal | >compile with >dmd telnet element //and switches Thx, this one works for me. >or use build (or bud) >build telnet // and switches | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply