FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Imports inside classes don't work

 
Post new topic   Reply to topic     Forum Index -> DSSS
View previous topic :: View next topic  
Author Message
bmn24



Joined: 27 Jan 2007
Posts: 6

PostPosted: Sun May 18, 2008 7:31 am    Post subject: Imports inside classes don't work Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DSSS All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group