www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - problem with gdc for OSX?

reply MLT <none anon.com> writes:
Sorry, this could be a bug report and not a question, and probably the wrong
place to post it then.

I installed gdc according to the instructions given in
http://www.dsource.org/projects/tango/wiki/MacOSXInstall
from http://sourceforge.net/project/downloading.php?group_id=135857&filename=gdc-trunk-r229-
mac-10.5.dmg&a=83983351

Install went well, compiling tango went well. Compiling programs with tango
works well.
However, now when I try to compile the simplest program that uses std.stdio I
get many errors, starting
with:
ldblcompat.d:36: Error: identifier 'string' is not defined

(below it, many complaints about string not defined, and also
include/d/4.0.1/std/format.d:75: Error: Error is used as a type )

My program is this:
import std.stdio ;
int main()
{
        writefln("Hello world!\n") ;
}

What am I doing wrong?
Apr 19 2009
next sibling parent reply "Denis Koroskin" <2korden gmail.com> writes:
On Sun, 19 Apr 2009 12:37:11 +0400, MLT <none anon.com> wrote:

 Sorry, this could be a bug report and not a question, and probably the  
 wrong place to post it then.

 I installed gdc according to the instructions given in  
 http://www.dsource.org/projects/tango/wiki/MacOSXInstall
 from  
 http://sourceforge.net/project/downloading.php?group_id=135857&filename=gdc-trunk-r229-
 mac-10.5.dmg&a=83983351

 Install went well, compiling tango went well. Compiling programs with  
 tango works well.
 However, now when I try to compile the simplest program that uses  
 std.stdio I get many errors, starting
 with:
 ldblcompat.d:36: Error: identifier 'string' is not defined

 (below it, many complaints about string not defined, and also
 include/d/4.0.1/std/format.d:75: Error: Error is used as a type )

 My program is this:
 import std.stdio ;
 int main()
 {
         writefln("Hello world!\n") ;
 }

 What am I doing wrong?
Bad installation, I suppose. 'string' is defined in Object.d, which is automatically imported in each source file. Error is defined there, too. Looks like it can't find it. Make sure it does exist and paths are properly configured. In a meanwhile try using DMD, it has OSX support now.
Apr 19 2009
parent reply MLT <none anon.com> writes:
== Quote from Denis Koroskin (2korden gmail.com)'s article

 Bad installation, I suppose. 'string' is defined in Object.d, which is
automatically imported in each
source file. Error is defined there, too. Looks like it can't find it. Make sure it does exist and paths are properly configured.
 In a meanwhile try using DMD, it has OSX support now.
Thanks! Yes, dmd works. I think it is a problem with the gcd package I used, because I had the same problem on two different computers. (Well, or I did the same mistakes) I wanted to use gdc because supposedly it works better with Xcode (though I haven't gotten that to work, yet). Something is definitely wrong with my installation. But I don't know what. What are the right files to look at? I didn't see a message about Object.d not being found. Is that the problem? I also noticed that /etc/dmd.conf and the environment variable DFLAGS didn't seem to have any effect on dmd on my mac. Modifying both had no effect, but compiling with "dmd $DFLAGS ..." worked. What is the right way to do things? thanks!
Apr 20 2009
parent reply Jacob Carlborg <doob me.com> writes:
MLT wrote:
 == Quote from Denis Koroskin (2korden gmail.com)'s article
 
 Bad installation, I suppose. 'string' is defined in Object.d, which is
automatically imported in each
source file. Error is defined there, too. Looks like it can't find it. Make sure it does exist and paths are properly configured.
 In a meanwhile try using DMD, it has OSX support now.
Thanks! Yes, dmd works. I think it is a problem with the gcd package I used, because I had the same problem on two different computers. (Well, or I did the same mistakes) I wanted to use gdc because supposedly it works better with Xcode (though I haven't gotten that to work, yet). Something is definitely wrong with my installation. But I don't know what. What are the right files to look at? I didn't see a message about Object.d not being found. Is that the problem? I also noticed that /etc/dmd.conf and the environment variable DFLAGS didn't seem to have any effect on dmd on my mac. Modifying both had no effect, but compiling with "dmd $DFLAGS ..." worked. What is the right way to do things? thanks!
DFLAGS is working for me. I've placed dmd.conf in the same folder as dmd. Mac OS X doesn't have /etc by default.
Apr 21 2009
next sibling parent =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
Jacob Carlborg wrote:
 Mac OS X doesn't have /etc by default.
Sure it does, it's just that it is symlinked into /private. --anders
Apr 21 2009
prev sibling parent MLT <none anon.com> writes:
Jacob Carlborg Wrote:

 DFLAGS is working for me. I've placed dmd.conf in the same folder as 
 dmd. Mac OS X doesn't have /etc by default.
That was the problem: dmd.conf was copied to /usr/local/bin The copy in /etc did nothing. The copy in /usr/local/bin was overriding any DFLAGS I set. And I couldn't get dmd to tell me where the config file that it is using is.
Apr 21 2009
prev sibling parent =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
MLT wrote:
 Sorry, this could be a bug report and not a question, and probably the wrong
place to post it then.
 
 I installed gdc according to the instructions given in
http://www.dsource.org/projects/tango/wiki/MacOSXInstall
 from http://sourceforge.net/project/downloading.php?group_id=135857&filename=gdc-trunk-r229-
 mac-10.5.dmg&a=83983351
 
 Install went well, compiling tango went well. Compiling programs with tango
works well.
 However, now when I try to compile the simplest program that uses std.stdio I
get many errors, starting
 with:
 ldblcompat.d:36: Error: identifier 'string' is not defined
 
 (below it, many complaints about string not defined, and also
 include/d/4.0.1/std/format.d:75: Error: Error is used as a type )
How did you install Tango ? Not with the package but manual, I take it ?
 My program is this:
 import std.stdio ;
 int main()
 {
         writefln("Hello world!\n") ;
 }
 
 What am I doing wrong?
That looks like a Phobos program, maybe you need Tangobos (std.compat) ? --anders
Apr 21 2009