Re: DUB Different Library Name

2015-07-11 Thread serh via Digitalmars-d-learn
On Sunday, 12 July 2015 at 05:18:24 UTC, Mike Parker wrote: This has nothing to do with DMD, DUB, or linking :) Derelict loads the shared libraries at runtime through the system API (LoadLibrary on Windows and dlopen elsewhere). Each package has a default set of library names it looks for. I wa

Re: socket server help

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sun, 12 Jul 2015 17:32:23 +1200, Rikki Cattermole wrote: > But seriously, vibe.d is also pretty easy for most use cases. Hence why > I'm saying it. that's until your operations are very-very fast, or your libraries have async API. hit the synchronous API, and everything will start turning to

Re: socket server help

2015-07-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/07/2015 5:13 p.m., ketmar wrote: On Sun, 12 Jul 2015 15:44:44 +1200, Rikki Cattermole wrote: Perhaps try vibe.d? It does support what you want, automatically. most of the time vibe.d seems to be overkill. that's like building a space ship to visit Aunt Ellie, who lives in a town nearby.

Re: Function pointer array slice?

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sat, 11 Jul 2015 11:37:03 +, Tofu Ninja wrote: >> void function() nothrow pure @nogc @safe [2]arrayName; >> >> is perfectly fine too. > > Ahh, guess that makes sense, I kept trying to put the [] over near > function()... attributes are the parts of the type. and the rule is really simpl

Re: DUB Different Library Name

2015-07-11 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 12 July 2015 at 02:14:06 UTC, serh wrote: This is what I get when I run "dub" in the directory: http://codepad.org/BpnOHVSV As mentioned, I already have respective Allegro libs installed, but as liballegro.so.5.0 instead of liballegro-5.0.so and so on. The C++ linker sees them fine

Re: DUB Different Library Name

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sun, 12 Jul 2015 02:14:04 +, serh wrote: > As mentioned, I already have respective Allegro libs installed, but as > liballegro.so.5.0 instead of liballegro-5.0.so and so on. > The C++ linker sees them fine, but I am not sure how to make dmd/DUB see > the correct libraries to link. Derelict

Re: socket server help

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sun, 12 Jul 2015 15:44:44 +1200, Rikki Cattermole wrote: > Perhaps try vibe.d? > It does support what you want, automatically. most of the time vibe.d seems to be overkill. that's like building a space ship to visit Aunt Ellie, who lives in a town nearby. signature.asc Description: PGP signa

Re: socket server help

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sun, 12 Jul 2015 02:53:57 +, Adwelean wrote: > Hello, > > I have a project of updater for a game with few functions for > administrate the game and for this i need a server to communicate with > my client side (written in C#). > > I started to create the server but i have a problem with t

Re: Calling D Code from Assembly

2015-07-11 Thread John via Digitalmars-d-learn
On Sunday, 12 July 2015 at 04:30:58 UTC, John wrote: Is there a way I can call D code from assembly without declaring functions as extern(C) and and doing it the C way? SOLVED: Found the calling convention description. http://dlang.org/abi.html

Calling D Code from Assembly

2015-07-11 Thread John via Digitalmars-d-learn
Is there a way I can call D code from assembly without declaring functions as extern(C) and and doing it the C way?

Re: socket server help

2015-07-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/07/2015 2:53 p.m., Adwelean wrote: Hello, I have a project of updater for a game with few functions for administrate the game and for this i need a server to communicate with my client side (written in C#). I started to create the server but i have a problem with the "async" part, i tried

socket server help

2015-07-11 Thread Adwelean via Digitalmars-d-learn
Hello, I have a project of updater for a game with few functions for administrate the game and for this i need a server to communicate with my client side (written in C#). I started to create the server but i have a problem with the "async" part, i tried std.concurrency for the receive threa

Re: DUB Different Library Name

2015-07-11 Thread serh via Digitalmars-d-learn
On Sunday, 12 July 2015 at 01:17:27 UTC, Mike Parker wrote: No Derelict package has a compile-time or link-time dependency on the libraries they bind. The libraries are loaded at run time. DUB doesn't know anything about those libraries, so you shouldn't be seeing such an error with 'dub build'

Re: DUB Different Library Name

2015-07-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 July 2015 at 16:43:39 UTC, serh wrote: Hello, I am trying to use Derelict's Allegro 5 in my DUB project, however, when I try to run `dub build` it says it cannot find liballegro-5.0.11.so and liballegro-5.0.so. I have both libraries installed as liballegro.so.5.0.11 and liba

Re: I'm getting NAN out of nowhere

2015-07-11 Thread flamencofantasy via Digitalmars-d-learn
On Thursday, 9 July 2015 at 15:14:43 UTC, Binarydepth wrote: This is my code : import std.stdio : writeln, readf; void main() { int[3] nums; float prom; foreach(nem; 0..2) { writeln("input a number : "); readf(" %d", &nums[nem]);

DUB Different Library Name

2015-07-11 Thread serh via Digitalmars-d-learn
Hello, I am trying to use Derelict's Allegro 5 in my DUB project, however, when I try to run `dub build` it says it cannot find liballegro-5.0.11.so and liballegro-5.0.so. I have both libraries installed as liballegro.so.5.0.11 and liballegro.so.5.0 under my Arch system respectively. Is th

Re: Array operations with array of structs

2015-07-11 Thread Peter via Digitalmars-d-learn
On Saturday, 11 July 2015 at 13:31:12 UTC, Peter wrote: So after looking into it a little bit... So now I'm trying to multiply the array by a double but it's giving incompatible type errors. opBinary, opBinaryRight, and opOpAssign are defined. I have: struct Vector3 { public double[3] _

Re: Array operations with array of structs

2015-07-11 Thread anonymous via Digitalmars-d-learn
On Saturday, 11 July 2015 at 13:31:12 UTC, Peter wrote: The postblit can only not take @nogc due to the array duplication which is understandable. I think the postblit might be redundant anyway since the struct is built on a static array so there is no possibility of two different Vect3s "point

Re: Array operations with array of structs

2015-07-11 Thread Peter via Digitalmars-d-learn
On Wednesday, 8 July 2015 at 06:05:54 UTC, ketmar wrote: do you see the gotcha? if you uncomment postblit or assigns, this build function fails to compile, as that operations aren't "pure nothrow @nogc @trusted", and they will be used for either assign or postblitting. So after looking into i

Re: Function pointer array slice?

2015-07-11 Thread Tofu Ninja via Digitalmars-d-learn
On Saturday, 11 July 2015 at 10:54:45 UTC, ketmar wrote: On Sat, 11 Jul 2015 09:54:40 +, tcak wrote: On Saturday, 11 July 2015 at 09:30:43 UTC, Tofu Ninja wrote: So simple syntax question, how do I make an array slice of function pointers? I just have no idea where to put the [] on somet

Re: DUB Build Linker Library Search Path

2015-07-11 Thread via Digitalmars-d-learn
On Friday, 10 July 2015 at 12:26:02 UTC, Per Nordlöw wrote: On Friday, 10 July 2015 at 12:04:53 UTC, Nordlöw wrote: Should be LFLAGS="-L/usr/lib/llvm-3.6/lib" dub build --compiler=/usr/bin/dmd but still fails I can't find any place in the DUB sources that reads `LFLAGS` from the envir

Re: Function pointer array slice?

2015-07-11 Thread ketmar via Digitalmars-d-learn
On Sat, 11 Jul 2015 09:54:40 +, tcak wrote: > On Saturday, 11 July 2015 at 09:30:43 UTC, Tofu Ninja wrote: >> So simple syntax question, how do I make an array slice of function >> pointers? >> >> I just have no idea where to put the [] on something like >> >> void function() nothrow pure

Re: Function pointer array slice?

2015-07-11 Thread tcak via Digitalmars-d-learn
On Saturday, 11 July 2015 at 09:30:43 UTC, Tofu Ninja wrote: So simple syntax question, how do I make an array slice of function pointers? I just have no idea where to put the [] on something like void function() nothrow pure @nogc @safe arrayName; Or should I just alias it and make an a

Function pointer array slice?

2015-07-11 Thread Tofu Ninja via Digitalmars-d-learn
So simple syntax question, how do I make an array slice of function pointers? I just have no idea where to put the [] on something like void function() nothrow pure @nogc @safe arrayName; Or should I just alias it and make an array of the alias? alias f = void function() nothrow pur

Re: why adding extern(C) cause a runtime error?

2015-07-11 Thread Dav1d via Digitalmars-d-learn
On Saturday, 11 July 2015 at 01:22:14 UTC, mzf wrote: win7 x86 dmd2.067.1 ok ubuntu x64 dmd2.067.1 error - import std.stdio; import std.socket; extern(C) void recv() { writeln("recv..."); } extern(C) void send() { writeln("send..."); } int m

Re: std.concurrency: The fate of unmatched messages

2015-07-11 Thread E.S. Quinn via Digitalmars-d-learn
On Saturday, 11 July 2015 at 02:15:02 UTC, ketmar wrote: so simply don't receive the messages you don't need right now. as i said, `receive()` doesn't look to top message only, it scans the whole mailbox, trying to find a message that matches. you can use `receiveTimeout()` to do nothing if t