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

Trying to use a library

 
Post new topic   Reply to topic     Forum Index -> Visual D
View previous topic :: View next topic  
Author Message
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Thu May 19, 2011 8:09 am    Post subject: Trying to use a library Reply with quote

So, I installed DFL and Entice. And create a form with the Entice designer.
Then I copied the code in visual D and tried to compile!

I got this error:
Error 1 Error: module all is in file 'dfl\all.d' which cannot be read C:\Dev\DTest\DTest1\myform.d 7

on
import dfl.all;

No I have DFL installed! all.d can be found in
C:\D\dmd2\windows\import\dfl\all.d
and the DMD install path is
C:\D\dmd2\windows\

How do I set the import path? There seems to be no way to specify it!

Further, I wonder (this is really a D newbie beginner question), what's the point of
C:\D\dmd2\windows\lib\dfl_build.lib if I got the whole DFL source in the "import" directory anyway?
Back to top
View user's profile Send private message AIM Address
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Thu May 19, 2011 8:27 am    Post subject: Reply with quote

After some reading.. I stumbled upon something which gave me an idea...

I edit the sc.ini as follows:

DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%@P%\..\import"


i.e. I added the import path to DFL
(why could I do that in the project's property screen?)

Now, when I try to compile I got this error:
Error 1 Error: module gc is in file 'std\gc.d' which cannot be read C:\D\dmd2\windows\bin\..\import\dfl\internal\dlib.d 516

And.. damn, there is no gc.d in
C:\D\dmd2\src\phobos\std mm...
Back to top
View user's profile Send private message AIM Address
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Fri May 20, 2011 1:05 am    Post subject: Reply with quote

Quote:
How do I set the import path? There seems to be no way to specify it!


Check the DMD page of the project configuration: "Additional Imports". No need to edit sc.ini.

Quote:
Now, when I try to compile I got this error:
Error 1 Error: module gc is in file 'std\gc.d' which cannot be read C:\D\dmd2\windows\bin\..\import\dfl\internal\dlib.d


It seems you are mixing D1 source code and the D2 compiler and its runtime library. Maybe you have to configure Entice to output D2 code.

See http://www.dsource.org/forums/viewtopic.php?t=5742 for another question regarding DFL and the link to some example project.
Back to top
View user's profile Send private message
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Fri May 20, 2011 2:26 am    Post subject: Reply with quote

Thanks for your answer!

I should say I was confused by this page "additional imports" "string import" which one should I use? Anyway Addition import did it!

Now I dropped DFL as it depends on the Tango which requires to... replace the runtime library! And I don't feel quite ready for that yet...

So I'm giving a go to DGui.

Now I can't compile it with Visual D, I get this strange error:
Error 1 Error 42: Symbol Undefined _D4dgui3all12__ModuleInfoZ C:\Dev\DTest\DTest1\


now, I', m trying to get inspired by the DGui samples (which compiled with a .bat file), apparently they feed the following 'arg' file to dmd to compile:
=======
events.d
..\dgui\build\debug\dgui_dbg.lib
-L/SUBSYSTEM:windows:4
-g
-debug
-odobj
-ofevents.exe
-I..
=======

I'm confused by a few things:
1. what's the point of the dgui.lib, there is the whole source code (that the compiler seems to look) in ".." (reference by '-I..')

2..... mmm still trying to understand what I don't understand.... mmm....
Back to top
View user's profile Send private message AIM Address
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Fri May 20, 2011 2:45 am    Post subject: Reply with quote

progress... (but still tumbling) on
project property => Linker => Library Files
I set "dgui_dbg.lib"

On .... Library Search Path
I set "C:\D\dgui\dgui\build\debug"

Just so you know
C:\D\dgui\dgui\build\debug\dgui_dbg.lib do exists!

The compilation fails and the buildlog is as follow (below) any tips?!?
------
Building Debug\DTest1.exe

Command Line

set PATH=C:\D\dmd2\windows\bin;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\\bin;%PATH%
set DMD_LIB=;C:\D\dgui\dgui\build\debug
dmd -g -debug -X -Xf"Debug\DTest1.json" -IC:\D\dgui -of"Debug\DTest1.exe_cv" -deps="Debug\DTest1.dep" -map "Debug\DTest1.map" -L/NOMAP dgui_dbg.lib hello.d
if errorlevel 1 goto reportError
if not exist "Debug\DTest1.exe_cv" (echo "Debug\DTest1.exe_cv" not created! && goto reportError)
echo Converting debug information...
"C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" -D2 "Debug\DTest1.exe_cv" "Debug\DTest1.exe"
if errorlevel 1 goto reportError
if not exist "Debug\DTest1.exe" (echo "Debug\DTest1.exe" not created! && goto reportError)

goto noError

:reportError
echo Building Debug\DTest1.exe failed!

:noError
Output

OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
dgui_dbg.lib
Warning 2: File Not Found dgui_dbg.lib
Debug\DTest1.obj(DTest1)
Error 42: Symbol Undefined _D4dgui3all12__ModuleInfoZ
--- errorlevel 1
Building Debug\DTest1.exe failed!
Back to top
View user's profile Send private message AIM Address
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Fri May 20, 2011 2:56 am    Post subject: Reply with quote

I think I understand....
Visual D create a variable "DMD_LIB" for my lib path, but it's wrong!
according to this document:
http://www.digitalmars.com/ctg/optlink.html

it should be 'LIB'

Anyway, instead of using 'dgui_dbg.lib' I used 'C:\D\dgui\dgui\build\debug\dgui_dbg.lib'

And that fixed it! Smile
(but it's rather cumbersome hey!)
Back to top
View user's profile Send private message AIM Address
sagitario



Joined: 03 Mar 2007
Posts: 292

PostPosted: Fri May 20, 2011 10:32 am    Post subject: Reply with quote

Sorry that you had to figure it out the stony way. This is a known issue: http://www.dsource.org/projects/visuald/wiki/KnownIssues#Librarysearchpathnotpassedtolinker

The problem is that it does not help to set the LIB environment variable, because the setting in sc.ini always causes dmd to override it. That's why I'm using a different variable that should be appended to LIB in sc.ini.
Back to top
View user's profile Send private message
lloyd



Joined: 16 May 2011
Posts: 18
Location: Australia

PostPosted: Fri May 20, 2011 11:22 am    Post subject: Reply with quote

Thanks for the precision, they are good to know!

I might made a new post in a few days, about it (and my later UI experiments)!
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Visual D 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