October 15, 2012
On Sunday, October 14, 2012 23:40:41 H. S. Teoh wrote:
> Funny, as soon as I said that, I manage to reproduce the same error
> messages (though I can't say if it's exactly the problem you're seeing)
> by compiling a file that doesn't define main(). In this case, I had a
> hello.d with main() renamed to Main():

Yes. The error message that he's getting is essentially the one that you get when you don't define main, which is weird, because he _is_ defining main. But I don't know if it's exactly the same or not. A detailed comparison of the error messages that he's seeing and those that you get from not defining main on a machine that works would be required to see whether it's exactly the same message or not.

I'm surprised that you didn't recognize the errors immediately. I guess that you haven't missed main very often (I'm used to it primarily from forgetting main when throwing together quick test scripts). But I'm totally stumped as to why he'd be getting them, since he does appear to be declaring main correctly.

- Jonathan M Davis
October 15, 2012
On Monday, 15 October 2012 at 06:47:06 UTC, Jonathan M Davis wrote:
> On Sunday, October 14, 2012 23:40:41 H. S. Teoh wrote:
>> Funny, as soon as I said that, I manage to reproduce the same error
>> messages (though I can't say if it's exactly the problem you're seeing)
>> by compiling a file that doesn't define main(). In this case, I had a
>> hello.d with main() renamed to Main():
>
> Yes. The error message that he's getting is essentially the one that you get
> when you don't define main, which is weird, because he _is_ defining main. But I
> don't know if it's exactly the same or not. A detailed comparison of the error
> messages that he's seeing and those that you get from not defining main on a
> machine that works would be required to see whether it's exactly the same
> message or not.
>
> I'm surprised that you didn't recognize the errors immediately. I guess that
> you haven't missed main very often (I'm used to it primarily from forgetting
> main when throwing together quick test scripts). But I'm totally stumped as to
> why he'd be getting them, since he does appear to be declaring main correctly.
>
> - Jonathan M Davis

Hi,

I decided to install the same distribution in a vm. This time instead of installing the .deb package, I went with the zip. Everything seems to be working! I can compile a non-trivial example just fine. I guess I'll definitely be using the zip from now on. Anyway, I also tried the zip version on Mac and Windoze. They both built the same code successfully. This is great! I can finally try out all of those great language features I've been reading about.

Thanks to everyone for pushing me down the rabbit hole far enough this time to get some payback ;-) It's on now!

Thanks,
-G










October 15, 2012
On 15 October 2012 04:10, Gerry Weaver <gerryw@compvia.com> wrote:
> Hello All,
>
> I have been looking at D off and on for several years. Initially I worked through a very painful experience to get D compiling on Linux. After that experience, I concluded that I should wait for it to become more mature. Since then, I do a very simple test. I install the latest package and try to build "Hello World". I figure that if "Hello World" builds successfully, I will continue further. I have just downloaded the latest .deb package and installed it on Ubuntu 12.04 32bit. Once again it fails this incredibly simple test. I've read many discussions about how/why, has/hasn't, will/won't D hit the mainstream in programming languages. I think this situation may offer at least one data point. I'm struggling to think of any other language (and I use several) that won't build code out of the box. D seems to have a lot of potential, but this needs to be fixed. I am not asking for help on this. I honestly don't care what the solution is. I just wanted the D developers to know why at least one developer is not using the language. I sincerely hope that the situation will improve. I'm looking forward to programming in D.
>
> Thanks for your time,
> -G
>
>
>
> Here is the code:
>
> import std.stdio;
>
>
> void main()
> {
>   writeln("Hello, world!");
> }
>
> Here is the command:
>
> dmd hello.d
>
> Here is the output:
>
> /usr/lib/i386-linux-gnu/libphobos2.a(dmain2_459_1a5.o): In function
> `_D2rt6dmain24mainUiPPaZi7runMainMFZv':
> src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x10): undefined
> reference to `_Dmain'
> /usr/lib/i386-linux-gnu/libphobos2.a(thread_18f_1b8.o): In function
> `_D4core6thread6Thread6__ctorMFZC4core6thread6Thread':
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x1d):
> undefined reference to `_tlsend'
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x24):
> undefined reference to `_tlsstart'
> /usr/lib/i386-linux-gnu/libphobos2.a(thread_19f_6e4.o): In function
> `thread_attachThis':
> src/core/thread.d:(.text.thread_attachThis+0xb7): undefined reference to
> `_tlsstart'
> src/core/thread.d:(.text.thread_attachThis+0xbc): undefined reference to
> `_tlsend'
> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17d_1b8.o): In function
> `_D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread':
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x1d):
> undefined reference to `_tlsend'
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x27):
> undefined reference to `_tlsstart'
> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17e_1b8.o): In function
> `_D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread':
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x1d):
> undefined reference to `_tlsend'
> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x27):
> undefined reference to `_tlsstart'
> /usr/lib/i386-linux-gnu/libphobos2.a(deh2_43b_525.o): In function
> `_D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable':
> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x4):
> undefined reference to `_deh_beg'
> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0xc):
> undefined reference to `_deh_beg'
> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x13):
> undefined reference to `_deh_end'
> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x36):
> undefined reference to `_deh_end'
> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17a_713.o): In function
> `thread_entryPoint':
> src/core/thread.d:(.text.thread_entryPoint+0x64): undefined reference to
> `_tlsend'
> src/core/thread.d:(.text.thread_entryPoint+0x6a): undefined reference to
> `_tlsstart'
> collect2: ld returned 1 exit status
> --- errorlevel 1
>
>

Try and paste the output of the following:

dmd -c hello.d
objdump -d hello.o


Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
October 15, 2012
On Monday, 15 October 2012 at 07:12:03 UTC, Iain Buclaw wrote:
> On 15 October 2012 04:10, Gerry Weaver <gerryw@compvia.com> wrote:
>> Hello All,
>>
>> I have been looking at D off and on for several years. Initially I worked
>> through a very painful experience to get D compiling on Linux. After that
>> experience, I concluded that I should wait for it to become more mature.
>> Since then, I do a very simple test. I install the latest package and try to
>> build "Hello World". I figure that if "Hello World" builds successfully, I
>> will continue further. I have just downloaded the latest .deb package and
>> installed it on Ubuntu 12.04 32bit. Once again it fails this incredibly
>> simple test. I've read many discussions about how/why, has/hasn't,
>> will/won't D hit the mainstream in programming languages. I think this
>> situation may offer at least one data point. I'm struggling to think of any
>> other language (and I use several) that won't build code out of the box. D
>> seems to have a lot of potential, but this needs to be fixed. I am not
>> asking for help on this. I honestly don't care what the solution is. I just
>> wanted the D developers to know why at least one developer is not using the
>> language. I sincerely hope that the situation will improve. I'm looking
>> forward to programming in D.
>>
>> Thanks for your time,
>> -G
>>
>>
>>
>> Here is the code:
>>
>> import std.stdio;
>>
>>
>> void main()
>> {
>>   writeln("Hello, world!");
>> }
>>
>> Here is the command:
>>
>> dmd hello.d
>>
>> Here is the output:
>>
>> /usr/lib/i386-linux-gnu/libphobos2.a(dmain2_459_1a5.o): In function
>> `_D2rt6dmain24mainUiPPaZi7runMainMFZv':
>> src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x10): undefined
>> reference to `_Dmain'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_18f_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x24):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_19f_6e4.o): In function
>> `thread_attachThis':
>> src/core/thread.d:(.text.thread_attachThis+0xb7): undefined reference to
>> `_tlsstart'
>> src/core/thread.d:(.text.thread_attachThis+0xbc): undefined reference to
>> `_tlsend'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17d_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x27):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17e_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x27):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(deh2_43b_525.o): In function
>> `_D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable':
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x4):
>> undefined reference to `_deh_beg'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0xc):
>> undefined reference to `_deh_beg'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x13):
>> undefined reference to `_deh_end'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x36):
>> undefined reference to `_deh_end'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17a_713.o): In function
>> `thread_entryPoint':
>> src/core/thread.d:(.text.thread_entryPoint+0x64): undefined reference to
>> `_tlsend'
>> src/core/thread.d:(.text.thread_entryPoint+0x6a): undefined reference to
>> `_tlsstart'
>> collect2: ld returned 1 exit status
>> --- errorlevel 1
>>
>>
>
> Try and paste the output of the following:
>
> dmd -c hello.d
> objdump -d hello.o
>
>
> Regards

Hi,

Here you go.

hello.o:     file format elf32-i386


Disassembly of section .text:

00000000 <.text>:
   0:	b8 10 00 00 00       	mov    $0x10,%eax
   5:	b9 00 00 00 00       	mov    $0x0,%ecx
   a:	8b 11                	mov    (%ecx),%edx
   c:	89 10                	mov    %edx,(%eax)
   e:	89 01                	mov    %eax,(%ecx)
  10:	c3                   	ret


Thanks,
-G
October 15, 2012
On Monday, 15 October 2012 at 07:12:03 UTC, Iain Buclaw wrote:
> On 15 October 2012 04:10, Gerry Weaver <gerryw@compvia.com> wrote:
>> Hello All,
>>
>> I have been looking at D off and on for several years. Initially I worked
>> through a very painful experience to get D compiling on Linux. After that
>> experience, I concluded that I should wait for it to become more mature.
>> Since then, I do a very simple test. I install the latest package and try to
>> build "Hello World". I figure that if "Hello World" builds successfully, I
>> will continue further. I have just downloaded the latest .deb package and
>> installed it on Ubuntu 12.04 32bit. Once again it fails this incredibly
>> simple test. I've read many discussions about how/why, has/hasn't,
>> will/won't D hit the mainstream in programming languages. I think this
>> situation may offer at least one data point. I'm struggling to think of any
>> other language (and I use several) that won't build code out of the box. D
>> seems to have a lot of potential, but this needs to be fixed. I am not
>> asking for help on this. I honestly don't care what the solution is. I just
>> wanted the D developers to know why at least one developer is not using the
>> language. I sincerely hope that the situation will improve. I'm looking
>> forward to programming in D.
>>
>> Thanks for your time,
>> -G
>>
>>
>>
>> Here is the code:
>>
>> import std.stdio;
>>
>>
>> void main()
>> {
>>   writeln("Hello, world!");
>> }
>>
>> Here is the command:
>>
>> dmd hello.d
>>
>> Here is the output:
>>
>> /usr/lib/i386-linux-gnu/libphobos2.a(dmain2_459_1a5.o): In function
>> `_D2rt6dmain24mainUiPPaZi7runMainMFZv':
>> src/rt/dmain2.d:(.text._D2rt6dmain24mainUiPPaZi7runMainMFZv+0x10): undefined
>> reference to `_Dmain'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_18f_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFZC4core6thread6Thread+0x24):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_19f_6e4.o): In function
>> `thread_attachThis':
>> src/core/thread.d:(.text.thread_attachThis+0xb7): undefined reference to
>> `_tlsstart'
>> src/core/thread.d:(.text.thread_attachThis+0xbc): undefined reference to
>> `_tlsend'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17d_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFPFZvkZC4core6thread6Thread+0x27):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17e_1b8.o): In function
>> `_D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread':
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x1d):
>> undefined reference to `_tlsend'
>> src/core/thread.d:(.text._D4core6thread6Thread6__ctorMFDFZvkZC4core6thread6Thread+0x27):
>> undefined reference to `_tlsstart'
>> /usr/lib/i386-linux-gnu/libphobos2.a(deh2_43b_525.o): In function
>> `_D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable':
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x4):
>> undefined reference to `_deh_beg'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0xc):
>> undefined reference to `_deh_beg'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x13):
>> undefined reference to `_deh_end'
>> src/rt/deh2.d:(.text._D2rt4deh213__eh_finddataFPvZPS2rt4deh29FuncTable+0x36):
>> undefined reference to `_deh_end'
>> /usr/lib/i386-linux-gnu/libphobos2.a(thread_17a_713.o): In function
>> `thread_entryPoint':
>> src/core/thread.d:(.text.thread_entryPoint+0x64): undefined reference to
>> `_tlsend'
>> src/core/thread.d:(.text.thread_entryPoint+0x6a): undefined reference to
>> `_tlsstart'
>> collect2: ld returned 1 exit status
>> --- errorlevel 1
>>
>>
>
> Try and paste the output of the following:
>
> dmd -c hello.d
> objdump -d hello.o
>
>
> Regards

Hi,

Here you go.

hello.o:     file format elf32-i386


Disassembly of section .text:

00000000 <.text>:
   0:	b8 10 00 00 00       	mov    $0x10,%eax
   5:	b9 00 00 00 00       	mov    $0x0,%ecx
   a:	8b 11                	mov    (%ecx),%edx
   c:	89 10                	mov    %edx,(%eax)
   e:	89 01                	mov    %eax,(%ecx)
  10:	c3                   	ret


Thanks,
-G

October 15, 2012
On Mon, 15 Oct 2012 08:36:22 +0200, Gerry Weaver <gerryw@compvia.com> wrote:

> Hi,
>
> I removed the dmd package and downloaded the .zip. I checked for any files that were left behind when the package was removed and they are gone. I then ran dmd from the zip package, but I get the same result. It would seem that dmd does not work on this particular distribution.
>

Maybe you still have an old dmd.conf at $HOME or somewhere else? It could be that it overrides the dmd.conf in the zip/deb file.

What do you get when you run $ locate dmd.conf?
October 15, 2012
On 2012-10-15 08:40, H. S. Teoh wrote:

> On that note, here's an enhancement request for dmd: if a program is
> missing main() for whatever reason, we really should have a more
> user-friendly error message than the reams of encrypted Klingon from the
> linker that almost nobody understands.

How should DMD detect if you're building a (dynamic) library? Sure it can see that you're not using -lib or -shared but what about separate complication?

-- 
/Jacob Carlborg
October 15, 2012
On 2012-10-15 05:10, Gerry Weaver wrote:
> Hello All,
>
> I have been looking at D off and on for several years. Initially I
> worked through a very painful experience to get D compiling on Linux.
> After that experience, I concluded that I should wait for it to become
> more mature. Since then, I do a very simple test. I install the latest
> package and try to build "Hello World". I figure that if "Hello World"
> builds successfully, I will continue further. I have just downloaded the
> latest .deb package and installed it on Ubuntu 12.04 32bit. Once again
> it fails this incredibly simple test. I've read many discussions about
> how/why, has/hasn't, will/won't D hit the mainstream in programming
> languages. I think this situation may offer at least one data point. I'm
> struggling to think of any other language (and I use several) that won't
> build code out of the box. D seems to have a lot of potential, but this
> needs to be fixed. I am not asking for help on this. I honestly don't
> care what the solution is. I just wanted the D developers to know why at
> least one developer is not using the language. I sincerely hope that the
> situation will improve. I'm looking forward to programming in D.

Just use DVM, it's also cross-platform:

https://bitbucket.org/doob/dvm

-- 
/Jacob Carlborg
October 15, 2012
On 15/10/12 06:42, Jonathan M Davis wrote:
> On Sunday, October 14, 2012 21:39:42 H. S. Teoh wrote:
>> This looks like what happens if you try to use the latest dmd release
>> with an old version of Phobos, perhaps installed along with gdc.
>>
>> Whoever's doing the .deb packaging really should add a versioned
>> Depends: field to debian/control so that it will require installation of
>> the correct version of Phobos, or, at the very least, refuse to install
>> if such is not available.
>
> At this point, it's a bad idea to use any version of druntime or Phobos which
> doesn't match exactly with the version of dmd that you're using. It's not as
> bad as it used to be, but there are still plenty of cases where a language
> change (be it a bug fix or added feature or whatever) makes it so that older
> versions of Phobos won't compile, or the latest Phobos ends up needing the
> latest dmd. I wouldn't advise anyone to use versions of them that don't all
> match.
>
> - Jonathan M Davis
>

I think we should have a version number in druntime which is checked by the compiler, and bumped every time an incompatible change is made. That way we could reduce the number of messages from frustrated and
bewildered users.
October 15, 2012
On Monday, 15 October 2012 at 05:27:14 UTC, H. S. Teoh wrote:
> On Mon, Oct 15, 2012 at 07:14:42AM +0200, Gerry Weaver wrote:
> [...]
>> Hi,
>> 
>> I checked it out. There is only a dmd.conf. I've included it below.
> [...]
>
> Strange, I have exactly the same copy of dmd.conf, and I didn't see a
> problem. I copy-n-pasted your code into the same filename, etc..
>
> What version of libc6 do you have? (dpkg -p libc6) Maybe dmd is
> incompatible with older versions of libc6?
>
>
> T

I tried to install DMD 2.060 in 32 bit Ubuntu 12.04 (live cd in virtual box). I had to do apt-get install -f after installing the deb to get the dependencies, but after that, it worked. So I don't think this is due to libc6 version.