Re: What is a good strategy for finding undefined symbols...

2012-05-13 Thread Mike Parker
On 5/13/2012 2:22 AM, WhatMeWorry wrote: Looks like you are trying to link. Libraries are not linked they are just compiled. Then object files are put together into library file. Link produces *executable* (yeah I recall that was hard to get at first). Wait, isn't that the whole point of

Re: Errors compiling programs using Derelict 3 under DMD 2

2012-05-13 Thread Mike Parker
On 5/13/2012 1:46 AM, Kevin Kowalczyk wrote: I posted on stackoverflow but there hasn't been much in the way of actually resolving my problem, I'll post the link here in the hopes someone can answer my question. http://stackoverflow.com/questions/10564608/using-derelict3-under-dmd2-d That

Re: Errors compiling programs using Derelict 3 under DMD 2

2012-05-13 Thread Mike Parker
On 5/13/2012 1:46 AM, Kevin Kowalczyk wrote: I posted on stackoverflow but there hasn't been much in the way of actually resolving my problem, I'll post the link here in the hopes someone can answer my question. http://stackoverflow.com/questions/10564608/using-derelict3-under-dmd2-d I should

Re: How do I do printf/writefln debugging in CTFE?

2012-05-13 Thread Dmitry Olshansky
On 13.05.2012 6:07, Chad J wrote: Hi, It's been a while since I've used CTFE, and I was wondering if it has become possible to do something like this: void ctfeFunc(string arg) { pragma(msg, arg is ~arg); } void main() { ctfeFunc(foo); } That specific attempt gives me an error: test.d(3):

shared attribute

2012-05-13 Thread japplegame
Does shared attribute automatic synchronization or should I do it manually?

Re: shared attribute

2012-05-13 Thread Jonathan M Davis
On Sunday, May 13, 2012 11:24:58 japplegame wrote: Does shared attribute automatic synchronization or should I do it manually? shared does not automatically synchronize anything. It just means that the variable is shared across threads rather than being thread-local, and the compiler takes

Re: Put Tuple in templates in a class fails

2012-05-13 Thread Xan
Thank you very much, Philippe. I have several questions: * Why do you think I can't compose functions with tuples? Your implentation does exactly this, isn't? * What is RHS? Thanks, Xan. On Thursday, 10 May 2012 at 20:17:12 UTC, Philippe Sigaud wrote: On Thu, May 10, 2012 at 4:48 PM, Xan

Re: shared attribute

2012-05-13 Thread japplegame
Thanks. Another question. This doesn't compile: shared char[] s = shared text.dup; with error: cannot implicitly convert expression (shared text) of type char[] to shared(char[]) Why do I need to write this? shared char[] s = cast(shared)shared text.dup; What is the meaning of this casting?

Re: shared attribute

2012-05-13 Thread Jonathan M Davis
On Sunday, May 13, 2012 13:36:31 japplegame wrote: Thanks. Another question. This doesn't compile: shared char[] s = shared text.dup; with error: cannot implicitly convert expression (shared text) of type char[] to shared(char[]) Why do I need to write this? shared char[] s =

Re: shared attribute

2012-05-13 Thread japplegame
Very intresting. Next question. :) Lets consider this example. import core.thread; import std.stdio; shared char[] s; char[] l = shared text.dup; void main() { Thread worker = new Thread(workerFunc); worker.start(); Thread.sleep(dur!seconds(5)); // after this point worker thread and its

Re: Put Tuple in templates in a class fails

2012-05-13 Thread Philippe Sigaud
On Sun, May 13, 2012 at 11:58 AM, Xan xancor...@gmail.com wrote: Thank you very much, Philippe. I have several questions: * Why do you think I can't compose functions with tuples? Your implentation does exactly this, isn't? Well, in D functions can only return one value. So you cannot

Re: shared attribute

2012-05-13 Thread Jonathan M Davis
On Sunday, May 13, 2012 14:35:14 japplegame wrote: Very intresting. Next question. :) Lets consider this example. import core.thread; import std.stdio; shared char[] s; char[] l = shared text.dup; void main() { Thread worker = new Thread(workerFunc); worker.start();

Re: shared attribute

2012-05-13 Thread japplegame
Thank you very much. I already readed this excellent article. Unfortunately, sometimes we need things that should be global and shared between threads. As far as I understand it is desirable to avoid casting to/from shared. It will be better to use something like this shared char[] s; shared

Re: libraries and c++ compatibility

2012-05-13 Thread dnewbie
On Sunday, 13 May 2012 at 02:44:22 UTC, Jason King wrote: I'm trying to use ocilib (deimos\ocilib) bindings and having some issues. dmd 2.0.59, Windows 7 64 bit. I can change sc.ini to get everything to build. I can compile with dmd myapp.d -Ipath_to_deimos -c, but I can't seem to figure out

optlink

2012-05-13 Thread Ellery Newcomer
Hey, a while back I was messing around with some winapi calls in D, and I had occasion to want to link to crypt32.dll, but dmd doesn't seem to ship with a crypt32.lib. I tried downloading the platform sdk or whatever the thing is called, but, um... dmd ssl_client.d C:\Program

Re: optlink

2012-05-13 Thread Andrej Mitrovic
use implib (http://ftp.digitalmars.com/bup.zip): implib /s Crypt32_implib.Lib Crypt32.Lib then use Crypt32_implib.Lib with dmd.

Re: optlink

2012-05-13 Thread Dmitry Olshansky
On 13.05.2012 18:41, Ellery Newcomer wrote: Hey, a while back I was messing around with some winapi calls in D, and I had occasion to want to link to crypt32.dll, but dmd doesn't seem to ship with a crypt32.lib. I tried downloading the platform sdk or whatever the thing is called, but, um...

Re: How do I do printf/writefln debugging in CTFE?

2012-05-13 Thread Chad J
On 05/13/2012 03:32 AM, Dmitry Olshansky wrote: On 13.05.2012 6:07, Chad J wrote: I want some way to print out the state of variables in a function being executed at compile time. Can it be done? Try pulling this guy (aka __ctfeWrite): https://github.com/D-Programming-Language/dmd/pull/692

shared associative array initialization

2012-05-13 Thread japplegame
I have no idea how to simple initialize shared associative array. This code compiled but causing access violation when running. shared uint[char] arr; shared static this() { // next expression seems wrong, because // arr is process related and ['a':1, 'b':2] is thread related // probably,

Re: D Dll injection problem

2012-05-13 Thread maarten van damme
I found a couple of errors in my code but couldn't get it to work.

Auto-casting in range based functions?

2012-05-13 Thread Andrew Stanton
I have been playing around with D as a scripting tool and have been running into the following issue: --- import std.algorithm; struct Delim { char delim; this(char d) { delim = d; } } void main() { char[] d = ['a', 'b', 'c']; auto

Re: Errors compiling programs using Derelict 3 under DMD 2

2012-05-13 Thread Kevin Kowalczyk
On Saturday, 12 May 2012 at 16:46:05 UTC, Kevin Kowalczyk wrote: I posted on stackoverflow but there hasn't been much in the way of actually resolving my problem, I'll post the link here in the hopes someone can answer my question.

Re: Auto-casting in range based functions?

2012-05-13 Thread Artur Skawina
On 05/13/12 19:49, Andrew Stanton wrote: I have been playing around with D as a scripting tool and have been running into the following issue: --- import std.algorithm; struct Delim { char delim; this(char d) { delim = d; } }

Re: libraries and c++ compatibility

2012-05-13 Thread Jason King
. C:\ocilib\ocilib3.9.3\lib32dmc myapp.cpp -c -Ic:\ocilib\ocilib3.9.3\include C:\ocilib\ocilib3.9.3\lib32optlink myapp.obj,,,ociliba-dm.lib OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved myapp.obj(myapp) Error 42: Symbol Undefined

Re: libraries and c++ compatibility

2012-05-13 Thread dnewbie
On Sunday, 13 May 2012 at 19:01:15 UTC, Jason King wrote: . C:\ocilib\ocilib3.9.3\lib32dmc myapp.cpp -c -Ic:\ocilib\ocilib3.9.3\include C:\ocilib\ocilib3.9.3\lib32optlink myapp.obj,,,ociliba-dm.lib OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights

Re: shared associative array initialization

2012-05-13 Thread Era Scarecrow
On Sunday, 13 May 2012 at 16:25:42 UTC, japplegame wrote: I have no idea how to simple initialize shared associative array. This code compiled but causing access violation when running. shared uint[char] arr; shared static this() { // next expression seems wrong, because // arr is

Re: Auto-casting in range based functions?

2012-05-13 Thread Jonathan M Davis
On Sunday, May 13, 2012 19:49:00 Andrew Stanton wrote: I have been playing around with D as a scripting tool and have been running into the following issue: --- import std.algorithm; struct Delim { char delim; this(char d) { delim = d;

Reading ASCII file with some codes above 127 (exten ascii)

2012-05-13 Thread Paul
I am reading a file that has a few extended ASCII codes (e.g. degree symdol). Depending on how I read the file in and what I do with it the error shows up at different points. I'm pretty sure it all boils down to the these extended ascii codes. Can I just tell dmd that I'm reading a Latin1

std.mmfile issues

2012-05-13 Thread Ondrej Pokorny
Hi all, I am trying to use std.mmfile on Win 7 64 bit, compiler dmd 32 2.059 MmFile memoryFile = new MmFile(test); I receive this error: std.exception.ErrnoException@std\mmfile.d(270): (No error) which is a little bit confusing for beginner. Am I using it in wrong way? I am trying to