Thread overview | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
April 06, 2006 DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
I've been dabbling around with D source code for a while, but never actually tried to compile anything just yet. I finally got around to compiling one of my projects, and run into this error on the very first class definition I have (if I comment out any class with /+ +/, it always occurs on the very next class definition in the file): data.d(45): identifier 'Object' is not defined data.d(45): Object is used as a type What's worse, however, is that the compiler is encountering an assertion failure: Assertion failure: 'b->type->ty == Tclass' on line 284 in file 'class.c' ..which leads me to believe that the dmd compiler itself is flaking out. Any insights? |
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Gibson | On Thu, 6 Apr 2006 04:48:07 +0000 (UTC), Jeremy Gibson <jtgibson telus net Jeremy_member@pathlink.com> wrote:
> I've been dabbling around with D source code for a while, but never actually
> tried to compile anything just yet. I finally got around to compiling one of my
> projects, and run into this error on the very first class definition I have (if
> I comment out any class with /+ +/, it always occurs on the very next class
> definition in the file):
>
> data.d(45): identifier 'Object' is not defined
> data.d(45): Object is used as a type
>
> What's worse, however, is that the compiler is encountering an assertion
> failure:
>
> Assertion failure: 'b->type->ty == Tclass' on line 284 in file 'class.c'
>
> ..which leads me to believe that the dmd compiler itself is flaking out.
>
> Any insights?
If you post a cut-down (yet complete) code example that exhibits the problem you'll get a faster response :)
Regan
|
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | >If you post a cut-down (yet complete) code example that exhibits the problem you'll get a faster response :) > >Regan Okay. ;-) /******************************************************************************* TEST FILE - test.d *******************************************************************************/ module test; class MyClass { } int main() { return 0; } |
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Gibson | Jeremy Gibson <jtgibson telus net> wrote:
>>If you post a cut-down (yet complete) code example that exhibits the problem you'll get a faster response :)
>>
>>Regan
>
>
> Okay. ;-)
>
>
> /*******************************************************************************
> TEST FILE - test.d
> *******************************************************************************/
>
> module test;
>
> class MyClass
> {
>
> }
>
>
> int main()
> {
> return 0;
> }
>
>
I'd say you've somehow got a broken installation? Sounds like the compiler cannot find the default -I path (usually pointing to dmd/src/phobos)
|
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Gibson | Jeremy Gibson wrote: >>If you post a cut-down (yet complete) code example that exhibits the >>problem you'll get a faster response :) >> >>Regan > > Okay. ;-) > > > /******************************************************************************* TEST FILE - test.d > *******************************************************************************/ > > module test; > > class MyClass > { > > } > > > int main() > { > return 0; > } Sounds like the compiler doesn't know where to look for the library source code. After you extract dmd.zip, you have to edit (dmd.conf on unix sc.ini) on windows and give DMD the directory where the phobos library source is (it comes with the compiler). ~John Demme |
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Demme | >Sounds like the compiler doesn't know where to look for the library source code. After you extract dmd.zip, you have to edit (dmd.conf on unix sc.ini) on windows and give DMD the directory where the phobos library source is (it comes with the compiler). > >~John Demme To install the compiler, I extracted both dmd.zip and dmc.zip into my C:\dev folder, such that the defaults should have worked just fine, assuming the %@P% evaluates correctly to the path to the current file as it's supposed to. Since I didn't trust that completely, though, I just manually set the paths to the following, replacing the relative paths with absolute paths, in order to match up to the extracted paths precisely: <sc.ini> [Version] version=7.51 Build 020 [Environment] LIB="C:\dev\dmd\lib;C:\dev\dm\lib" DFLAGS="-I C:\dev\dmd\src\phobos" LINKCMD="C:\dev\dm\bin\link.exe" ..But I still have no luck -- the same errors are being thrown on compilation. I just tried redownloading the compiler, also with no luck. Maybe it just hates me? ;-) --JT |
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Gibson | On Thu, 6 Apr 2006 05:35:16 +0000 (UTC), Jeremy Gibson <jtgibson telus net Jeremy_member@pathlink.com> wrote:
>> Sounds like the compiler doesn't know where to look for the library source
>> code. After you extract dmd.zip, you have to edit (dmd.conf on unix
>> sc.ini) on windows and give DMD the directory where the phobos library
>> source is (it comes with the compiler).
>>
>> ~John Demme
>
>
> To install the compiler, I extracted both dmd.zip and dmc.zip into my C:\dev
> folder, such that the defaults should have worked just fine, assuming the %@P%
> evaluates correctly to the path to the current file as it's supposed to.
>
> Since I didn't trust that completely, though, I just manually set the paths to
> the following, replacing the relative paths with absolute paths, in order to
> match up to the extracted paths precisely:
>
> <sc.ini>
>
> [Version]
> version=7.51 Build 020
>
> [Environment]
> LIB="C:\dev\dmd\lib;C:\dev\dm\lib"
> DFLAGS="-I C:\dev\dmd\src\phobos"
> LINKCMD="C:\dev\dm\bin\link.exe"
>
>
> ..But I still have no luck -- the same errors are being thrown on compilation.
> I just tried redownloading the compiler, also with no luck.
>
> Maybe it just hates me? ;-)
Can you post the exact output of the compile.
Regan
|
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | On Thu, 06 Apr 2006 17:38:42 +1200, Regan Heath <regan@netwin.co.nz> wrote:
> On Thu, 6 Apr 2006 05:35:16 +0000 (UTC), Jeremy Gibson <jtgibson telus net Jeremy_member@pathlink.com> wrote:
>>> Sounds like the compiler doesn't know where to look for the library source
>>> code. After you extract dmd.zip, you have to edit (dmd.conf on unix
>>> sc.ini) on windows and give DMD the directory where the phobos library
>>> source is (it comes with the compiler).
>>>
>>> ~John Demme
>>
>>
>> To install the compiler, I extracted both dmd.zip and dmc.zip into my C:\dev
>> folder, such that the defaults should have worked just fine, assuming the %@P%
>> evaluates correctly to the path to the current file as it's supposed to.
>>
>> Since I didn't trust that completely, though, I just manually set the paths to
>> the following, replacing the relative paths with absolute paths, in order to
>> match up to the extracted paths precisely:
>>
>> <sc.ini>
>>
>> [Version]
>> version=7.51 Build 020
>>
>> [Environment]
>> LIB="C:\dev\dmd\lib;C:\dev\dm\lib"
>> DFLAGS="-I C:\dev\dmd\src\phobos"
>> LINKCMD="C:\dev\dm\bin\link.exe"
>>
>>
>> ..But I still have no luck -- the same errors are being thrown on compilation.
>> I just tried redownloading the compiler, also with no luck.
>>
>> Maybe it just hates me? ;-)
>
> Can you post the exact output of the compile.
I ask because I wanted to see if there were any clues in the compiler/linker output that might suggest something.
Have you added "C:\dev\dmd\bin" to your PATH?
Regan
|
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | >Can you post the exact output of the compile. > >Regan Pretty much exactly similar to the first post on the thread, but I'll include the command prompt and omit my witty banter for clarity. " C:\Documents and Settings\JT\My Documents\Programming\Alliance>dmd test.d -debug test.d(8): identifier 'Object' is not defined test.d(8): Object is used as a type Assertion failure: 'b->type->ty == Tclass' on line 286 in file 'class.c' abnormal program termination C:\Documents and Settings\JT\My Documents\Programming\Alliance> " I'm going to try adding those directories directly to my system's PATH environment variable and see if that'll help... --JT |
April 06, 2006 Re: DMD compiler choking? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy Gibson | >I'm going to try adding those directories directly to my system's PATH environment variable and see if that'll help...
Still nothing. Same errors through and through.
(I had actually added C:\dev\dmd\bin to my path a long time ago -- I needed it in my path to be able to use the command-line compiler from my project folder, after all.)
--JT
|
Copyright © 1999-2021 by the D Language Foundation