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

dfl command not working for me

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Mon Apr 25, 2005 5:11 pm    Post subject: dfl command not working for me Reply with quote

I'm using dfl 0.8 snapshot 050417 with dmd .121 on Xp-Home SP2. The dfl code is within the dmd\import\dfl subdirectory. The dfl.lib is within the dmd\lib subdirectory.

Here is my sc.ini file:
**************************
[Version]
version=7.51 Build 020

[Environment]
LIB="?@P?\..\lib"
DFLAGS="-I?@P?\..\src\phobos;?@P?\..\import"
LINKCMD=?@P?\link.exe
**************************

With the normal dmd command, I can compile, link, and execute beginner.d (and the other example code) fine:
dmd beginner.d dfl.lib -L/exet:nt/su:windows:4.0

However, I get all kinds of errors when I follow the instructions for using dfl within beginner.d ... are they obsolete or am I doing something wrong? The info in the beginner.d comment doesn't agree with the usage notes when running just dfl from the command line (which also doesn't work for me)

from command line:
dfl beginner -gui

results in these error messages (and many more ... these are the first). There is a warning that it couldn't find dfl.lib ... seems to be looking in bin? But beginner.exe was actually built and seems to work.

X:\DevTools\Dmd\bin\link beginner,,,X:\DevTools\Dmd\bin\dfl.lib+user32+kernel32/noi/exet:nt/su:windows:4.0;

OPTLINK (R) for Win32 Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved

X:\DevTools\Dmd\bin\dfl.lib
Warning 2: File Not Found X:\DevTools\Dmd\bin\dfl.lib
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl11application11Application3runFC3dfl4form4FormZv
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl10messagebox6msgBoxFAaAaE3dfl10messagebox13MsgBoxButtonsE3dfl10messagebox10MsgBoxIconZE3dfl4base12DialogResult
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl7drawing5Point6opCallFiiZS3dfl7drawing5Point
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl5event6Event_5Event11opCatAssignFDFC6ObjectC3dfl5event9EventArgsZvZv
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl7textbox11TextBoxBase5linesFZAAa
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl6button11RadioButton7checkedFZb
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl6button11RadioButton7checkedFbZv

... and so on for several hundred more lines ...
Back to top
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon Apr 25, 2005 10:35 pm    Post subject: Re: dfl command not working for me Reply with quote

Lynn wrote:
X:\DevTools\Dmd\bin\dfl.lib
Warning 2: File Not Found X:\DevTools\Dmd\bin\dfl.lib
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl11application11Application3runFC3dfl4form4FormZv
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl10messagebox6msgBoxFAaAaE3dfl10messagebox13MsgBoxButtonsE3dfl10messagebox10MsgBoxIconZE3dfl4base12DialogResult
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl7drawing5Point6opCallFiiZS3dfl7drawing5Point
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl5event6Event_5Event11opCatAssignFDFC6ObjectC3dfl5event9EventArgsZvZv
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl7textbox11TextBoxBase5linesFZAAa
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl6button11RadioButton7checkedFZb
beginner.obj(beginner)
Error 42: Symbol Undefined _D3dfl6button11RadioButton7checkedFbZv

... and so on for several hundred more lines ...
I just ran into this problem myself, but I'm unsure of the best solution.

I suspect it's this recently mentioned issue: since DFL 0.8 was built with a pre-0.121 version of DMD, either an earlier version of DMD should be used or DFL would need to be rebuilt. I like to use the latest version of DMD, I tried using the latest snapshot (Apr 17, 2005). Now, there are fewer linker messages. Maybe, I still need to rebuild dfl.lib? I'll experiment more later.
Back to top
View user's profile Send private message AIM Address
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon Apr 25, 2005 10:47 pm    Post subject: Reply with quote

I got my problem fixed now. It turns out I didn't need to rebuild the new snapshot at all. I just forgot to copy dfl.lib to my \dmd\lib directory. Embarassed
Back to top
View user's profile Send private message AIM Address
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 9:21 am    Post subject: Reply with quote

I'm baffled ... I've got dfl.lib in the place indicated by sc.ini. When I use the full command line, dfl.lib is found ok, the compile+link works, and the resulting beginner.exe executes fine.

Perhaps this is a "who cares" since the normal command line works ok:
dmd beginner.d dfl.lib -L/exet:nt/su:windows:4.0

I think it is disconcerting to a dfl newbie to have the very first thing you try fail to work. The OOBE (out of box experience) creates a bad first impression. Perhaps I'm doing something wrong, but:
dfl beginner -gui
fails to compile.
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Apr 26, 2005 10:50 am    Post subject: Reply with quote

Lynn wrote:
I'm baffled ... I've got dfl.lib in the place indicated by sc.ini. When I use the full command line, dfl.lib is found ok, the compile+link works, and the resulting beginner.exe executes fine.

dfl.exe will echo the command line it uses to call dmd. Try copy and pasting that to the command line and execute it yourself. If it still fails, try tinkering with it until it works. It could be that you have two copies of dmd or dfl and the wrong one is being used.
dfl.exe does not depend on sc.ini at all; it uses the directory layout to find the files so that no setup is required. If you moved dfl.exe it will fail.
Back to top
View user's profile Send private message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 12:23 pm    Post subject: Reply with quote

Quote:
dfl.exe will echo the command line it uses to call dmd. Try copy and pasting that to the command line and execute it yourself. If it still fails, try tinkering with it until it works. It could be that you have two copies of dmd or dfl and the wrong one is being used.
dfl.exe does not depend on sc.ini at all; it uses the directory layout to find the files so that no setup is required. If you moved dfl.exe it will fail.


Here is what I invoked from the the command line. There is a single dfl.exe, located in X:\DevTools\dmd\bin, which is within the PATH.

Code:
X:\DevTools\Dmd\import\dfl\examples>dfl beginner -gui


This is generated by dfl.exe and invokes the compiler:

Code:
X:\DevTools\Dmd\bin\dmd.exe beginner -IX:\DevTools\Dmd\bin -L/exet:nt/su:windows
:4.0 X:\DevTools\Dmd\bin\dfl.lib


This is also generated by dfl.exe and invokes the linker.

Code:
X:\DevTools\Dmd\bin\link.exe beginner,,,X:\DevTools\Dmd\bin\dfl.lib+user32+kerne
l32/noi/exet:nt/su:windows:4.0;


I don't have a problem getting your .d code to compile/link ... I can just use the basic dmd command or a Visual Studio project. This is more of a concern for someone even more of a newbie than me, who might very well be frustrated and give up if the very first thing they tried didn't work:
dfl beginner -gui

Something that might be non-standard. I combined the dm and dmd paths into X:\DevTools\dmd. The compiler and linker are together, rather than using X:\DevTools\dm.

Does dfl.exe assume there is a dm subdirectory?
Back to top
View user's profile Send private message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 12:30 pm    Post subject: Reply with quote

FWIW:
Here's the usage information from invoking dfl from an XP command line prompt:

*********************************
DFL written by Christopher E. Miller
Usage:
dfl [<switches...>] <files...>

Switches:
-dmd Show DMD's usage.
-dfl-gui Make a Windows GUI exe without a console.
-dfl-con Make a console exe (default).
-dfl-exet=<x> Override executable type.
-dfl-su=<x1:x2> Override subsystem name and version.
-dfl-i Force install.
<other> Any other non-dfl switches are passed to DMD.
Files:
Files passed to DMD.
****************************

You might want to consider a version number. Also, the switches don't agree with the comment in the source code, where -gui and -con are mentioned rather than -dfl-gui and -dfl-con. This could be disconcerting to newbies getting up-to-speed.
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Tue Apr 26, 2005 12:40 pm    Post subject: Reply with quote

Lynn wrote:
Does dfl.exe assume there is a dm subdirectory?

No.

It looks like you moved dfl.exe to X:\DevTools\Dmd\bin whereas the dfl source directory is in X:\DevTools\Dmd\import. dfl.exe and dfl directory must reside in the same directory, like it's arranged in the zip file.

Quote:
Also, the switches don't agree with the comment in the source code, where -gui and -con are mentioned rather than -dfl-gui and -dfl-con.

yea, the dfl- and dmd- prefixes are optional. If omitted it'll try to pass the switches to the correct program.

Have I made bad choices here?

-Chris
Back to top
View user's profile Send private message
Lynn



Joined: 27 Aug 2004
Posts: 89

PostPosted: Tue Apr 26, 2005 1:24 pm    Post subject: Reply with quote

Quote:
Have I made bad choices here?


Well, your directory structure isn't how I would have done it, but I'm certainly not an authority.

To me, dfl.exe belongs in dmd\bin. I prefer not to have a proliferation of entries in the PATH. dfl.lib belongs in dmd\lib

With the way your dfl.zip unzips, you might rename some of the subdirectories to dfl_examples, dfl_doc, etc.. I wouldn't think you want to leave dfl.lib at the top level, since it belongs in dmd\lib. Perhaps consider having your .zip conform more to the directories that already exist in a default dmd installation.

I'm not clear if having dfl.exe really accomplishes anything except something else to go wrong. Your example code has the suggested dmd command line provided, which is sufficient, and more than some tool-meisters provide.

FWIW: I have the following directory structure:

X:\DevTools\dmd
bin (has dfl.exe)
import
import\dfl (includes all.d, base.d, etc)
import\dfl\doc
import\dfl\examples
include
lib (has dfl.lib)
src
src\phobos

I think I got the idea of dmd\import from one of your posts. I guess your dfl.zip would work ok if it was "under" dmd\import. Then you need to change the sc.ini, which tends to get overwritten with each new install of dmd.zip.

There is something to be said for having an environment variable for something like DMD_HOME or DFL_HOME, like java's JAVA_HOME and wxWidgets WXWIN.

It might help to have an NSIS installer that prompted for where the DMD home directory is located. It could unzip into a preferred directory structure based on that. As part of installation, it could run some kind of sanity check that the different pieces could "find" each other.

But the above assumes you want the dfl code and dmd within the same directory tree structure. There are problems with that, also, if a person wants separate directory trees. It just so happens I like them is close proximity ... other people's preferences might vary.

Getting everying "knitted together" is often one of the big challenges to this game ... but as they say, "if it was easy, it wouldn't pay so well" <g>
[/quote]
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL 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