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

Undefined symbols when compiling simple file

 
Post new topic   Reply to topic     Forum Index -> ArcLib
View previous topic :: View next topic  
Author Message
Boscop



Joined: 26 Feb 2009
Posts: 29

PostPosted: Thu Feb 26, 2009 9:36 am    Post subject: Undefined symbols when compiling simple file Reply with quote

I installed Arclib with DSSS and I wanted to compile this file:
Code:
module ArcTest;
// include input, window, and font to display "hello world"
import
arc.input,
arc.window,
arc.font,
arc.math.point,
arc.draw.color;

/**
* References: http://dmedia.dprogramming.com/?n=Tutorials.ArcIntro
*             http://dsource.org/projects/arclib/wiki/Documentation
* */
int main()
{
   // Open window with title, screen width, height, and bits per pixel
   arc.window.open("Hello World", 400,300,0);

   // Open input handling
   arc.input.open();

   // Open font system
   arc.font.open();

   // Create a new font with height of 20
   Font font = new Font("font.ttf", 20);

   // while the user doesn't press the QUIT button
   while (!arc.input.keyDown(ARC_QUIT))
   {
      // process input
      arc.input.process();

      // clear the current screen
      arc.window.clear();

      // draw the font in the center of the screen
      font.draw("Hello Arc World"c, Point(200,200),Color.Green);

      // swap window buffers
      arc.window.swap();
   }

   // close font system
   arc.font.close();

   // clean ourselves up and exit
   arc.window.close();

   return 0;
}


But it says:

Quote:
> "dmd.exe" ArcTest.d

OPTLINK (R) for Win32 Release 8.00.1
Copyright (C) Digital Mars 1989-2004 All rights reserved.
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc6window5clearFZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4math5point5Point6opCallFddZS3arc4math5point5Point
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4draw5color5Color5GreenS3arc4draw5color5Color
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc6window4swapFZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4font5closeFZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc6window5closeFZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc6window4openFAaiibbZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc5input4openFbZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4font4openFZv
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4font4Font7__ClassZ
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc4font4Font5_ctorMFAaiZC3arc4font4Font
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc5input7keyDownFiZb
ArcTest.obj(ArcTest)
Error 42: Symbol Undefined _D3arc5input7processFZv
--- errorlevel 13

> Process Exit Code: 13
> Time Taken: 00:14


What is wrong?


BTW: Do dmd and DSSS use different include paths because on my first try it didn't found arc.input.d? When I added DSSS's include path to sc.ini it was found, but threw the messages above. Should I put every (newly installed) lib into DSSS's path and clear dmd's for clarity?
_________________
A programmer is just a tool to convert coffeine into code!
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Fri Feb 27, 2009 9:04 pm    Post subject: Reply with quote

See:

http://dmedia.dprogramming.com/?n=Tutorials.ArcIntro
http://dsource.org/forums/viewtopic.php?t=4259

-------

The problem is that you are trying to build using DMD instead of DSSS.
Create a dsss.conf file in your directory with a single line

[yourFileName.d]

And try building using the command 'dsss build.'

~ Clay
Back to top
View user's profile Send private message AIM Address
Boscop



Joined: 26 Feb 2009
Posts: 29

PostPosted: Sat Feb 28, 2009 8:11 am    Post subject: Reply with quote

Thanks! I don't know why I didn't try that.
_________________
A programmer is just a tool to convert coffeine into code!
Back to top
View user's profile Send private message
Boscop



Joined: 26 Feb 2009
Posts: 29

PostPosted: Tue Mar 03, 2009 1:57 pm    Post subject: Reply with quote

For my new project I want to try the Poseidon IDE. It throws the same errors as above because it doesn't seem to know of dsss. Is there a way to fix these linking errors (recompilation of the libs with some options?) so that the libs can be used also with dmd and bud?
_________________
A programmer is just a tool to convert coffeine into code!
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Tue Mar 03, 2009 8:11 pm    Post subject: Reply with quote

Is there some way to change the 'build' command to be simply 'dsss build' with Poseidon?
Back to top
View user's profile Send private message AIM Address
Boscop



Joined: 26 Feb 2009
Posts: 29

PostPosted: Wed Mar 04, 2009 9:23 am    Post subject: Reply with quote

No, in the options only the paths of dmd, dmc, bud, Res Tool and debugger can be set. On compilation the tools are invoked automatically.

How does dsss compile the libs so that they are not usable with normal dmd compilation? Can't I compile them so that they can be used by both?
_________________
A programmer is just a tool to convert coffeine into code!
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Mar 05, 2009 5:08 pm    Post subject: Reply with quote

DSSS is nice because it allows you to install and uninstall the different libraries easily and you don't have to copy D files to your path to build your project.

With bud, you have to set up your project to have all the project compilation files (D files) in the folder of your project and then bud will pull the source that you need.

With bud, you'd set your project up like

project/
derelict/etc.
arc/etc.
main.d
Back to top
View user's profile Send private message AIM Address
Boscop



Joined: 26 Feb 2009
Posts: 29

PostPosted: Tue Mar 10, 2009 2:29 am    Post subject: Reply with quote

Can't I pass an additional search path so that the same libs are compatible with both?
_________________
A programmer is just a tool to convert coffeine into code!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> ArcLib 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