Re: D and .lib files. C++/Other?

2017-07-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 2 July 2017 at 05:33:45 UTC, Damien Gibson wrote: K im retarded... So I forgot the golden rule, debug libs with debug app, release libs with release app.. I attempted loading the debug version of dll with D again just to see what kinda errors (may) come up there, sure enough there is

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
K im retarded... So I forgot the golden rule, debug libs with debug app, release libs with release app.. I attempted loading the debug version of dll with D again just to see what kinda errors (may) come up there, sure enough there is and i get a fairly detailed one... However, when the functio

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:23:57 UTC, Void-995 wrote: Looking good, but I'm thinking more about 1:1 GLSL syntax (main reason - rapid prototype of GLSL/HLSL/OpenCL in D and code portability back and forward basing on usage) and heavy depending on SIMD. Just math and nothing else. Also may

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:07:48 UTC, Void-995 wrote: can i use simd as base to extend it's syntax for making something like GLM for C++? You can use simd to implement something like GLM, but extending the syntax of SIMD will prove more difficult. vector types are a bit different in LDC an

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
Well I ended up getting it to compile finally by adding extern "C" before the function imports on C++ side (Again i added the extern(C) to D side) however i still end up not being able to run the program as it keeps telling me: 0xC005: Access violation reading location 0x Ive been

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
If you're wanting to use the names (e.g. "ConsoleWrite") as is on the C++ side them you need to declare them extern(C++) ( or extern(C)) on the D side. if you were to run whatever the equivalent of "nm my.dll | grep Console" on windows on the dll then you'd see the two symbols with a different

Re: std.string.format call from varyargs

2017-07-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 2 July 2017 at 00:49:30 UTC, LeqxLeqx wrote: Hello! How does one go about invoking a templated-variatic function such as std.string.format with an array of objects? For example: string stringMyThing (string formatForMyThings, MyThing[] myThings) { return format( formatForM

Re: weird error message

2017-07-01 Thread Ali Çehreli via Digitalmars-d-learn
On 07/01/2017 04:56 PM, crimaniak wrote: > about very long error messages generated in some > cases. Please submit a bug report. The compiler may be able to abbreviate certain types. For example, in this case most of the error message text is values of a static array elements. Ali

std.string.format call from varyargs

2017-07-01 Thread LeqxLeqx via Digitalmars-d-learn
Hello! How does one go about invoking a templated-variatic function such as std.string.format with an array of objects? For example: string stringMyThing (string formatForMyThings, MyThing[] myThings) { return format( formatForMyThings, myThings ); } In executing the above,

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:23:57 UTC, Void-995 wrote: On Saturday, 1 July 2017 at 19:16:12 UTC, drug wrote: 01.07.2017 22:07, Void-995 пишет: (Void-995) Hi, everyone. I'm pretty excited with what have D to offer for game development, especially meta programming, traits, object.factory, sig

Re: weird error message

2017-07-01 Thread crimaniak via Digitalmars-d-learn
On Saturday, 1 July 2017 at 22:46:06 UTC, Adam D. Ruppe wrote: On Saturday, 1 July 2017 at 22:44:33 UTC, crimaniak wrote: enum moduleMask = ctRegex!`module\s+([^;]+)`; That should be `static`, not `enum`. I betcha that will at least change the error. Works both variants, and reason

Re: D and .lib files. C++/Other?

2017-07-01 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 1 July 2017 at 20:47:55 UTC, Damien Gibson wrote: Well I finally somehow got it to stop complaining about a bad lib file, but now it wants to tell me the entry point for the functions i list isnt correct, so now im just unsure if its being stupid on me or im not writing something w

Re: weird error message

2017-07-01 Thread Ali Çehreli via Digitalmars-d-learn
On 07/01/2017 03:44 PM, crimaniak wrote: > Captures c = findModule.output.matchFirst!(moduleMask); > > result (even C++ guys will be impressed): > > phobos_imports.d(43): Error: struct std.regex.Captures(R, DIndex = > size_t) if (isSomeString!R) is used as a type From the error message, it l

Re: weird error message

2017-07-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 July 2017 at 22:44:33 UTC, crimaniak wrote: enum moduleMask = ctRegex!`module\s+([^;]+)`; That should be `static`, not `enum`. I betcha that will at least change the error.

weird error message

2017-07-01 Thread crimaniak via Digitalmars-d-learn
Just for fun (may be): code: auto findModule = execute(["dscanner", "--etags", entry.name]); enum moduleMask = ctRegex!`module\s+([^;]+)`; Captures c = findModule.output.matchFirst!(moduleMask); result (even C++ guys will be impressed): phobos_imports.d(43): Error: stru

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
Well I finally somehow got it to stop complaining about a bad lib file, but now it wants to tell me the entry point for the functions i list isnt correct, so now im just unsure if its being stupid on me or im not writing something write on the D or C++ end... The D code: _

Re: D, Game Development, GLSL, Math

2017-07-01 Thread Void-995 via Digitalmars-d-learn
On Saturday, 1 July 2017 at 19:16:12 UTC, drug wrote: 01.07.2017 22:07, Void-995 пишет: (Void-995) Hi, everyone. I'm pretty excited with what have D to offer for game development, especially meta programming, traits, object.factory, signals and bunch of other neat things that may save a lot of

Re: D, Game Development, GLSL, Math

2017-07-01 Thread drug via Digitalmars-d-learn
01.07.2017 22:07, Void-995 пишет: (Void-995) Hi, everyone. I'm pretty excited with what have D to offer for game development, especially meta programming, traits, object.factory, signals and bunch of other neat things that may save a lot of time. Also, i saw support for vector data types and si

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
Not sure if this is the issue you're having, but if you're using .lib files on Windows, note that DMD, the D compiler, will by default, on 32bit, output a format (OMF) that is not compatible what Visual Studio is using (COFF). For 64bit, DMD outputs COFF .lib files. For 32bit, use the -m32mscof

D, Game Development, GLSL, Math

2017-07-01 Thread Void-995 via Digitalmars-d-learn
(Void-995) Hi, everyone. I'm pretty excited with what have D to offer for game development, especially meta programming, traits, object.factory, signals and bunch of other neat things that may save a lot of time. Also, i saw support for vector data types and simd, which sounds awesome. The ques

Re: D and .lib files. C++/Other?

2017-07-01 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-07-01 20:13, Damien Gibson wrote: Hi... A while back i had some issues with making a usable dll file, to which i did manage to figure out... Though while trying to use it with C++ i kept getting an error about a corrupted lib file... Not sure if this is the issue you're having, but if y

Re: D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
Note: I am only on windows as well so i have no idea if the issue remains the same for Linux and it may be a windows specific issue? Also I was using Visual Studio 2013 C++ so i have no idea if its limited to issues there either, I'm on super slow internet (Not dialup but might as well be) So i

D and .lib files. C++/Other?

2017-07-01 Thread Damien Gibson via Digitalmars-d-learn
Hi... A while back i had some issues with making a usable dll file, to which i did manage to figure out... Though while trying to use it with C++ i kept getting an error about a corrupted lib file... I had in mind the idea to create a few dlls as me and a few friends(Mixed between C++ users a

Re: rank of range

2017-07-01 Thread drug via Digitalmars-d-learn
01.07.2017 20:33, Ali Çehreli пишет: On 07/01/2017 10:05 AM, drug wrote: Hello! Is there a convenient way to get rank of range a.k.a. count of dimensions in compile time? Like: static assert( rankOf!(uint[]) == 1); static assert( rankOf!(uint[][][]) == 3); I'm not aware of one but this seems

Re: rank of range

2017-07-01 Thread Ali Çehreli via Digitalmars-d-learn
On 07/01/2017 10:05 AM, drug wrote: Hello! Is there a convenient way to get rank of range a.k.a. count of dimensions in compile time? Like: static assert( rankOf!(uint[]) == 1); static assert( rankOf!(uint[][][]) == 3); I'm not aware of one but this seems to work: template rankOf(R) { imp

rank of range

2017-07-01 Thread drug via Digitalmars-d-learn
Hello! Is there a convenient way to get rank of range a.k.a. count of dimensions in compile time? Like: static assert( rankOf!(uint[]) == 1); static assert( rankOf!(uint[][][]) == 3);

Re: ReadProcessMemory + address from ollydbg

2017-07-01 Thread bauss via Digitalmars-d-learn
On Saturday, 1 July 2017 at 00:48:01 UTC, bauss wrote: On Saturday, 1 July 2017 at 00:40:11 UTC, ag0aep6g wrote: [...] Yeah, the cast was unnecessary. So this is my code after the changes: string ReadWinString(HANDLE process, DWORD address, size_t stringSize, string defaultValue = "") { i

Re: How to partially apply member functions?

2017-07-01 Thread Balagopal Komarath via Digitalmars-d-learn
On Friday, 30 June 2017 at 08:43:32 UTC, ct wrote: It compiled when I wrote: auto on_next_previous = &this.OnNextPreviousMatch; entry_.addOnNextMatch(&partial!(on_next_previous, true)); entry_.addOnPreviousMatch(&partial!(on_next_previous, false)); But not when I wrote: entry_.addOnNextMatch(p