www.digitalmars.com         C & C++   DMDScript  

D - Problems with compiler

reply Alessandro <Alessandro_member pathlink.com> writes:
Hi,
I've just installed the D compiler following requisites and instructions.

However, when I try to compile a simple "Hello" program, the compiler gives me
the following error :

Error : error reding file 'object.d'

What happens?

Thanks a lot.

Alessandro Picetti

Italy
May 31 2002
parent reply "Walter" <walter digitalmars.com> writes:
Try the flag:
    -I\dm\src\phobos

"Alessandro" <Alessandro_member pathlink.com> wrote in message
news:ad7tks$2gq3$1 digitaldaemon.com...
 Hi,
 I've just installed the D compiler following requisites and instructions.

 However, when I try to compile a simple "Hello" program, the compiler

 the following error :

 Error : error reding file 'object.d'

 What happens?

 Thanks a lot.

 Alessandro Picetti

 Italy

May 31 2002
parent reply "Carlos" <carlos8294 msn.com> writes:
"Walter" <walter digitalmars.com> escribió en el mensaje
news:ad8cjp$31eo$2 digitaldaemon.com...
 Try the flag:
     -I\dm\src\phobos

It seems to be very common. Why don't you make the compiler to automatically look for that path? Then the -I flag would only modify the default.
May 31 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Carlos" <carlos8294 msn.com> wrote in message
news:ad99c8$10d0$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> escribió en el mensaje
 news:ad8cjp$31eo$2 digitaldaemon.com...
 Try the flag:
     -I\dm\src\phobos


 look for that path? Then the -I flag would only modify the default.

Good question. The answer is I don't like hardcoded paths in the executables <g>.
May 31 2002
next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Walter" <walter digitalmars.com> wrote in message
news:ad9ocd$1fsl$1 digitaldaemon.com...

 "Carlos" <carlos8294 msn.com> wrote in message
 news:ad99c8$10d0$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> escribió en el mensaje
 news:ad8cjp$31eo$2 digitaldaemon.com...
 Try the flag:
     -I\dm\src\phobos


 look for that path? Then the -I flag would only modify the default.

Good question. The answer is I don't like hardcoded paths in the

 <g>.

It's not necessary such, by the way. Mine version is E:\Language\DMD\src\phobos =) Maybe a config file, or an environment variable?
May 31 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Environment variables are old school.

Mine's installed in C:\DMD\src\phobos, because that's where the few D
samples' script seemed to want to look for it.

Installation into the root is old school and is annoying.  Programs are
supposed to install into the Program Files folder by default.

Sean

 It's not necessary such, by the way. Mine version is
 E:\Language\DMD\src\phobos =)
 Maybe a config file, or an environment variable?

Jun 01 2002
next sibling parent reply "Marius S." <mars centras.lt> writes:
Sean L. Palmer wrote:
 Environment variables are old school.
 
 Mine's installed in C:\DMD\src\phobos, because that's where the few D
 samples' script seemed to want to look for it.
 
 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

windows isn't THE ONLY operating system... IMHO
Jun 01 2002
next sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Marius S." <mars centras.lt> wrote in message
news:3CF8DBB3.9010505 centras.lt...

 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

windows isn't THE ONLY operating system... IMHO

It'll be /usr/bin, then =)
Jun 01 2002
prev sibling parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Don't troll.  The Win32 version of DMD is a Windows program and should
behave as other Windows programs do.  I could care less what the future
Linux version of DMD does.  It'll probably use lots of command line switches
and environment variables, because that seems to be the UNIX way of doing
things.  On Windows, the docs should be in .CHM format, on Linux, docs will
likely be in MAN format or maybe just a textfile.  Mac versions of DMD will
be different still.

Sean

"Marius S." <mars centras.lt> wrote in message
news:3CF8DBB3.9010505 centras.lt...
 Sean L. Palmer wrote:
 Environment variables are old school.

 Mine's installed in C:\DMD\src\phobos, because that's where the few D
 samples' script seemed to want to look for it.

 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

windows isn't THE ONLY operating system... IMHO

Jun 01 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adbgf6$1gc3$1 digitaldaemon.com...
 Don't troll.  The Win32 version of DMD is a Windows program and should
 behave as other Windows programs do.  I could care less what the future
 Linux version of DMD does.  It'll probably use lots of command line

 and environment variables, because that seems to be the UNIX way of doing
 things.  On Windows, the docs should be in .CHM format, on Linux, docs

 likely be in MAN format or maybe just a textfile.  Mac versions of DMD

 be different still.

I agree with you that things should be customized to work as expected on the particular machine it is implemented on. But I disagree about documentation. I find that html is a great way to do documentation, and it works well on win32. Just typing in the name of the file will bring it up all nicely formatted in a browser window. It enables the online documents to be identical (saves on maintenance costs). It's much better than windows help is.
Jun 03 2002
next sibling parent reply "Martin M. Pedersen" <mmp www.moeller-pedersen.dk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:adg4ej$1o24$1 digitaldaemon.com...
 I agree with you that things should be customized to work as expected on

 particular machine it is implemented on. But I disagree about

 I find that html is a great way to do documentation, and it works well on
 win32.

I like HTML documentation too, and I normally use Doxygen to make it. It is a great tool that also allows the documentation to be generated in e.g. Latex, CHM, RTF, and XML, thereby reducing maintenance cost even further. Latex and RTF are good for printed documentation, while HTML is not. XML is good for further processing. For these reasons, I prefer the Doxygen (or JavaDoc) approach for documentation. Regards, Martin M. Pedersen
Jun 03 2002
next sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Martin M. Pedersen" <mmp www.moeller-pedersen.dk> wrote in message
news:adg5d2$1osp$1 digitaldaemon.com...

 I like HTML documentation too, and I normally use Doxygen to make it. It

 a great tool that also allows the documentation to be generated in e.g.
 Latex, CHM, RTF, and XML, thereby reducing maintenance cost even further.
 Latex and RTF are good for printed documentation, while HTML is not. XML

 good for further processing. For these reasons, I prefer the Doxygen (or
 JavaDoc) approach for documentation.

Doxygen and other similar tools are good to document the source code of the program, or an interface of a library. They were not intended to be used for purpose of making "generic" documentation, like the D reference guide.
Jun 03 2002
prev sibling parent reply "OddesE" <OddesE_XYZ hotmail.com> writes:
"Martin M. Pedersen" <mmp www.moeller-pedersen.dk> wrote in message
news:adg5d2$1osp$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:adg4ej$1o24$1 digitaldaemon.com...
 I agree with you that things should be customized to work as expected on

 particular machine it is implemented on. But I disagree about

 I find that html is a great way to do documentation, and it works well


 win32.

I like HTML documentation too, and I normally use Doxygen to make it. It

 a great tool that also allows the documentation to be generated in e.g.
 Latex, CHM, RTF, and XML, thereby reducing maintenance cost even further.
 Latex and RTF are good for printed documentation, while HTML is not. XML

 good for further processing. For these reasons, I prefer the Doxygen (or
 JavaDoc) approach for documentation.

 Regards,
 Martin M. Pedersen

I agree with you on this. Doxygen and JavaDoc rule! I even proposed special syntax in the language to support such tools, so we would have a standard for writing documentation too... I guess in the absence of such a standard the wisest thing to do for future DDoc writers would be to analyse DoxyGen and JavaDoc, to decide on the best format. -- Stijn OddesE_XYZ hotmail.com http://OddesE.cjb.net _________________________________________________ Remove _XYZ from my address when replying by mail
Jun 11 2002
parent "anderson" <anderson firestar.com.au> writes:
<snip>
 I agree with you on this. Doxygen and JavaDoc rule!

 wisest thing to do for future DDoc writers would
 be to analyse DoxyGen and JavaDoc, to decide on
 the best format.

I agree i'd be nice to have something like that in D. Parhaps there's a way to improve on DoxyGen and JavaDoc to make the output even more intuative. --Just a thought For example I'd be good if the generated doc would beable to compare differn't versions/depresiations and even generate something simular to the Walters "Converting C to D" page. Perhaps the commenting would be something like this /* Title = ... Version = "D" (or a number) Description = you no longer need to ... AlsoSee = Func1, Func2 ... Arg1 = ... Arg2 = ... Returns = ... Version = "C" (or a number) Description = you have to .... */ bool Func(int Arg1, int Arg2) { } And version would be optional. The topmost version would be considered the latest version. Older version documentation would only be placed in the versioning docs. The latest version would be used for the main hieratically documents. Perhaps there could be a special commenting character in D for this instead of /* */. I'd be nice if this was built into the complier, but that's probably to much extra work, and could be done in a make/bat (yuk) file instead. Perhaps DoxyGen and JavaDoc already have something like that, which I missed. But I'd agree that this would probably be to complex for at least the initial version.
Jun 16 2002
prev sibling next sibling parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Walter" <walter digitalmars.com> wrote in message
news:adg4ej$1o24$1 digitaldaemon.com...

 I agree with you that things should be customized to work as expected on

 particular machine it is implemented on. But I disagree about

 I find that html is a great way to do documentation, and it works well on
 win32. Just typing in the name of the file will bring it up all nicely
 formatted in a browser window. It enables the online documents to be
 identical (saves on maintenance costs). It's much better than windows help
 is.

The only problem with HTML docs, they cannot be searched for topics/keywords. However, there are solutions of that problem, varying across the platforms. I think it would be a good idea to compile it into CHM for Windows distribution...
Jun 03 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:adg7f4$1r5b$1 digitaldaemon.com...
 The only problem with HTML docs, they cannot be searched for
 topics/keywords.

Yes, though I am using Atomz as a workaround for that.
 However, there are solutions of that problem, varying across the

 I think it would be a good idea to compile it into CHM for Windows
 distribution...

If there was a reliable html->chm compiler that might be a possibility (reliable in that no tweaking is necessary). Otherwise, I doubt it is worth the effort.
Jun 03 2002
next sibling parent "anderson" <anderson firestar.com.au> writes:
I like the HTML. Even windows uses html for alot of it's help documention.
It would be nice to have a search feature however.

"Walter" <walter digitalmars.com> wrote in message
news:adgd45$20t0$2 digitaldaemon.com...
 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:adg7f4$1r5b$1 digitaldaemon.com...
 The only problem with HTML docs, they cannot be searched for
 topics/keywords.

Yes, though I am using Atomz as a workaround for that.
 However, there are solutions of that problem, varying across the

 I think it would be a good idea to compile it into CHM for Windows
 distribution...

If there was a reliable html->chm compiler that might be a possibility (reliable in that no tweaking is necessary). Otherwise, I doubt it is

 the effort.

Jun 03 2002
prev sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Walter" <walter digitalmars.com> wrote in message
news:adgd45$20t0$2 digitaldaemon.com...

 If there was a reliable html->chm compiler that might be a possibility
 (reliable in that no tweaking is necessary). Otherwise, I doubt it is

 the effort.

I don't think you need tweaking to make a CHM out of a set of HTMLs. The only thing that needs to be done, one must create a hierarchical table of contents.
Jun 03 2002
prev sibling next sibling parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
It's just that there's so many loose .GIF files that way.  ;(   And it's not
as searchable.

That wasn't my main point.  HTML help is fine.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:adg4ej$1o24$1 digitaldaemon.com...
 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:adbgf6$1gc3$1 digitaldaemon.com...
 Don't troll.  The Win32 version of DMD is a Windows program and should
 behave as other Windows programs do.  I could care less what the future
 Linux version of DMD does.  It'll probably use lots of command line

 and environment variables, because that seems to be the UNIX way of


 things.  On Windows, the docs should be in .CHM format, on Linux, docs

 likely be in MAN format or maybe just a textfile.  Mac versions of DMD

 be different still.

I agree with you that things should be customized to work as expected on

 particular machine it is implemented on. But I disagree about

 I find that html is a great way to do documentation, and it works well on
 win32. Just typing in the name of the file will bring it up all nicely
 formatted in a browser window. It enables the online documents to be
 identical (saves on maintenance costs). It's much better than windows help
 is.

Jun 03 2002
parent "Walter" <walter digitalmars.com> writes:
Oh, the only gif files I use are the logo and the silly cartoons I drew up
one day <g>.

"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adgb2d$1unv$1 digitaldaemon.com...
 It's just that there's so many loose .GIF files that way.  ;(   And it's

 as searchable.

 That wasn't my main point.  HTML help is fine.

 Sean

Jun 03 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Walter" <walter digitalmars.com> wrote in message
news:adg4ej$1o24$1 digitaldaemon.com...
 I agree with you that things should be customized to work as expected on

 particular machine it is implemented on. But I disagree about

 I find that html is a great way to do documentation, and it works well on
 win32. Just typing in the name of the file will bring it up all nicely
 formatted in a browser window. It enables the online documents to be
 identical (saves on maintenance costs). It's much better than windows help
 is.

And I forgot to mention - if you don't have an html browser, you can still read the documentation because it's ascii. This is better than, say Microsoft Word files or Adobe Acrobat files in which the text cannot be extracted without a specialized file reader.
Jun 03 2002
prev sibling next sibling parent reply "anderson" <anderson firestar.com.au> writes:
But It's easy to back-path, so I don't see a problem there.they should be
written with
cd.. (or whatever the OS uses), to back work out the most likely place of
things.

ie sample
C:\<whatever>\DMD\samples\d
Would go something like,
..\..\bin\dmd <other>

In other words use ralative pathing not direct pathing.

"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ad9rpr$1m4f$1 digitaldaemon.com...
 Environment variables are old school.

 Mine's installed in C:\DMD\src\phobos, because that's where the few D
 samples' script seemed to want to look for it.

 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

 Sean

 It's not necessary such, by the way. Mine version is
 E:\Language\DMD\src\phobos =)
 Maybe a config file, or an environment variable?


Jun 01 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"anderson" <anderson firestar.com.au> wrote in message
news:adak9k$j77$1 digitaldaemon.com...
 But It's easy to back-path, so I don't see a problem there.they should be
 written with
 cd.. (or whatever the OS uses), to back work out the most likely place of
 things.

 ie sample
 C:\<whatever>\DMD\samples\d
 Would go something like,
 ..\..\bin\dmd <other>

 In other words use ralative pathing not direct pathing.

This won't work as is, because I could run dmd even from another disk... but the path could be relative to the location of dmd.exe, which can be determined by GetModulePath on Windows.
Jun 02 2002
parent "anderson" <anderson firestar.com.au> writes:
I understand that, I was trying to present a general case. I was talking in
regards to the "samples" included that are generally installed at that
location in the hierarchy. And I'll defiantly need some more work.

But your probably right, It may only work on my machine.


"Pavel Minayev" <evilone omen.ru> wrote in message
news:adcfnj$2gh3$1 digitaldaemon.com...
 "anderson" <anderson firestar.com.au> wrote in message
 news:adak9k$j77$1 digitaldaemon.com...
 But It's easy to back-path, so I don't see a problem there.they should


 written with
 cd.. (or whatever the OS uses), to back work out the most likely place


 things.

 ie sample
 C:\<whatever>\DMD\samples\d
 Would go something like,
 ..\..\bin\dmd <other>

 In other words use ralative pathing not direct pathing.

This won't work as is, because I could run dmd even from another disk... but the path could be relative to the location of dmd.exe, which can be determined by GetModulePath on Windows.

Jun 02 2002
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ad9rpr$1m4f$1 digitaldaemon.com...
 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

Us command line curmudgeons don't like directories with spaces in them (you have to put "" around the arguments, making it more difficult to touch-type). In any case, hardcoded paths are usually a bad idea because people do have different preferences as to where it should be installed.
Jun 01 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
"Walter" <walter digitalmars.com> wrote in message
news:adb2ha$11qt$3 digitaldaemon.com...
 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:ad9rpr$1m4f$1 digitaldaemon.com...
 Installation into the root is old school and is annoying.  Programs are
 supposed to install into the Program Files folder by default.

Us command line curmudgeons don't like directories with spaces in them

 have to put "" around the arguments, making it more difficult to
 touch-type).

I understand. I used to be a big CLI person myself back in the DOS days maybe 5 or 6 years ago. I just don't find it productive anymore. I actually curse Microsoft for making all the basic folders have such long unwieldy names. (Program Files, Documents And Settings, My Pictures, cmon give me a break I just want Programs, Documents, Pictures. In fact I'd rather have Prog, Doc, and Pic. Most concepts can be expressed by one word if you choose the word carefully.)
 In any case, hardcoded paths are usually a bad idea because
 people do have different preferences as to where it should be installed.

I said "by default"... the installer is supposed to ask you where to put it. Then it sets up all the nasty environment variables or registry entries for you. Ideally the program wouldn't require any and it would (A) ask the operating system where it is located (location of DMD.EXE) (B) attempt to search that general area for its configuration file (..\CONFIG\CONFIG.INI or whatever) (C) if it can't find a config file, use some default relative paths and/or complain that the user needs to make a config file. (D) get the paths out of that config file. Sean
Jun 01 2002
parent "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adbgv0$1gqm$1 digitaldaemon.com...
 I understand.  I used to be a big CLI person myself back in the DOS days
 maybe 5 or 6 years ago.  I just don't find it productive anymore.

I've occaisionally tried to use guis, but the lack of a history buffer makes it slow for me.
 I actually curse Microsoft for making all the basic folders have such long
 unwieldy names.  (Program Files,   Documents And Settings, My Pictures,

 give me a break I just want Programs, Documents, Pictures.  In fact I'd
 rather have Prog, Doc, and Pic.  Most concepts can be expressed by one

 if you choose the word carefully.)

Yes, that stuff is really annoying. Just try and find what directory XP puts the email files in. It's so unwieldy (and uses hidden directories) I wrote a .bat file just to cd to it.
 I said "by default"... the installer is supposed to ask you where to put

 Then it sets up all the nasty environment variables or registry entries

 you.  Ideally the program wouldn't require any and it would
 (A) ask the operating system where it is located (location of DMD.EXE)
 (B) attempt to search that general area for its configuration file
 (..\CONFIG\CONFIG.INI or whatever)
 (C) if it can't find a config file, use some default relative paths and/or
 complain that the user needs to make a config file.
 (D) get the paths out of that config file.

That's what the C/C++ compiler does, and DMD does it now, too. No need at all for registry settings.
Jun 03 2002
prev sibling parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Have it search GetModulePath\..\lib if it can't find the import library
anywhere else.  That's hardcoded yet relative to the compiler \bin folder;
it's not quite so bad.  ;)  And, lib is the standard folder in the dmd
distribution.  This would be equivalent to C's #include <sysheader.h> yet D
would not have to require special syntax for system imports.

Since DMD is a Win32 executable, the proper Way of Doing Things on Windows
these days is to store these sort of paths in the registry.  It's part of
the compiler installation process and is not hardcoded.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:ad9ocd$1fsl$1 digitaldaemon.com...
 "Carlos" <carlos8294 msn.com> wrote in message
 news:ad99c8$10d0$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> escribió en el mensaje
 news:ad8cjp$31eo$2 digitaldaemon.com...
 Try the flag:
     -I\dm\src\phobos


 look for that path? Then the -I flag would only modify the default.

Good question. The answer is I don't like hardcoded paths in the

 <g>.

Jun 01 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:ad9rlb$1lpi$1 digitaldaemon.com...

 Have it search GetModulePath\..\lib if it can't find the import library
 anywhere else.  That's hardcoded yet relative to the compiler \bin folder;
 it's not quite so bad.  ;)  And, lib is the standard folder in the dmd
 distribution.  This would be equivalent to C's #include <sysheader.h> yet

 would not have to require special syntax for system imports.

Yes, agreed. I think it is the best way. Used it in my "compiler" =) stuff myself. Very convenient to the end-users - just unzip the archive, and compiler's ready.
Jun 01 2002
parent "anderson" <anderson firestar.com.au> writes:
Also an automatic installer that set it all up would be good. Or even a
setup program that first searches the most likly places.  I agree that It's
a frustraion to new users to have to type
-I\dm\src\phobos.

If it doesn't find the phobos libary in a list of most likly places, it
could give the user the option to search for it and record it in a local
file.

I've written such thing myself and there not that hard.

"Pavel Minayev" <evilone omen.ru> wrote in message
news:adaa8u$4ht$1 digitaldaemon.com...
 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:ad9rlb$1lpi$1 digitaldaemon.com...

 Have it search GetModulePath\..\lib if it can't find the import library
 anywhere else.  That's hardcoded yet relative to the compiler \bin


 it's not quite so bad.  ;)  And, lib is the standard folder in the dmd
 distribution.  This would be equivalent to C's #include <sysheader.h>


 D
 would not have to require special syntax for system imports.

Yes, agreed. I think it is the best way. Used it in my "compiler" =) stuff myself. Very convenient to the end-users - just unzip the archive, and compiler's ready.

Jun 01 2002