bmn24
Joined: 27 Jan 2007 Posts: 6
|
Posted: Sun May 18, 2008 7:31 am Post subject: Imports inside classes don't work |
|
|
DSSS doesn't seem to understand imports that are located inside a class. The example below fails with following error:
Code: | >dsss build
test.d => test
+ C:\dsss\bin\rebuild.exe -Idsss_imports\ -I. -S.\ -IC:\dsss\include\d -SC:\dsss
\lib\ -IC:\dsss\include\d -SC:\dsss\lib -oqdsss_objs\D test.d -oftest
OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
dsss_objs\D\_test.obj(_test)
Error 42: Symbol Undefined _D5test23fooFZi
--- errorlevel 1
Command C:\dsss\bin\rebuild.exe returned with code -1, aborting.
Error: Command failed, aborting. |
If the import is moved before the class, it works as expected.
Example:
Code: | /*** test.d ***/
module test;
int main(char[][] args) {
new Test();
return 0;
}
public class Test {
import test2;
public this() {
foo();
}
}
|
Code: | /*** test2.d ***/
module test2;
int foo() {
return 0;
}
|
Code: | /*** dsss.conf ***/
[test.d]
target = test
|
|
|