Re: DUB is not working correctly

2021-02-24 Thread evilrat via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:46:20 UTC, Maxim wrote: Sure, here are dub.json contents: { "authors": [ "Max" ], "copyright": "Copyright © 2021, Max", "description": "A minimal D application.", "license": "proprietary",

Re: DUB is not working correctly

2021-02-24 Thread evilrat via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 16:13:48 UTC, Maxim wrote: Hello, I have problems with working in dub environment. If I try to init my project with 'dub init', all needed files will be created successfully. However, when I run 'dub run', the manager gives me an error: 'Configuration

Re: is it posible to compile individual module separately?

2021-02-16 Thread evilrat via Digitalmars-d-learn
On Tuesday, 16 February 2021 at 07:01:53 UTC, bokuno_D wrote: i run "dub build" on it. but OOM kill the compiler. - is there a way to reduce memory consumtion of the compiler? or maybe third party tool? alternative to dub? Assuming you are using DMD, there is -lowmem switch to enable garbage

Re: Is there other way to do that?

2021-02-15 Thread evilrat via Digitalmars-d-learn
On Monday, 15 February 2021 at 07:26:56 UTC, Jack wrote: I need to check if an instance is of a specific type derived from my base class but this class has template parameter and this type isn't available at time I'm checking it. Something like: Non-templated interface/base class is

Re: Can change vtbl record at runtime ?

2021-02-03 Thread evilrat via Digitalmars-d-learn
On Wednesday, 3 February 2021 at 08:26:05 UTC, Max Haughton wrote: On Wednesday, 3 February 2021 at 05:30:37 UTC, Виталий Фадеев wrote: Possible to change the vtbl record at runtime ? Has functional for update vtbl records ? Do you mean "Can I set onSuccess" at runtime? The virtual tables

Re: Class Allocators

2021-01-31 Thread evilrat via Digitalmars-d-learn
On Sunday, 31 January 2021 at 23:19:09 UTC, Kyle wrote: My best guess right now is that both class allocators and the placement new syntax are deprecated, but if that's the case I would expect a deprecation message when I try to use that new(address) Type syntax whether there's a class

Re: Why am I getting a dividing by zero error message

2021-01-28 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 January 2021 at 18:37:37 UTC, Ruby The Roobster wrote: Here is the output/input of the program: Type in data for an egg: Width: 3 Hight: 2 object.Error@(0): Integer Divide by Zero 0x004023FE 0x0040CF9F 0x0040CF19 0x0040CDB4 0x00409033 0x00402638 0x75F86359 in

Re: Dll crash in simplest case

2021-01-25 Thread evilrat via Digitalmars-d-learn
On Monday, 25 January 2021 at 11:30:45 UTC, Vitalii wrote: On Monday, 25 January 2021 at 10:26:20 UTC, frame wrote: [...] Yes. I'm doing it whet add dll.d (https://wiki.dlang.org/Win32_DLLs_in_D) in compile line, it contents: --- import core.sys.windows.windows; import

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-24 Thread evilrat via Digitalmars-d-learn
On Sunday, 24 January 2021 at 11:44:04 UTC, Marcone wrote: Qt5 dlls Well, you are out of luck. It is doable, but... Normally you would likely want to use static libraries and link them into your executable, with Qt license however it becomes problematic in pretty much any case, you still

Re: How can I create a Standalone Bundle Portable file application using Dlang?

2021-01-19 Thread evilrat via Digitalmars-d-learn
On Tuesday, 19 January 2021 at 11:10:25 UTC, Marcone wrote: On Tuesday, 19 January 2021 at 06:25:31 UTC, Imperatorn wrote: On Monday, 18 January 2021 at 19:42:22 UTC, Marcone wrote: How can I create a Standalone Bundle Portable file application using Dlang? Could you describe what you mean

Re: How can I specify flags for the compiler when --build=release in dub?

2021-01-15 Thread evilrat via Digitalmars-d-learn
On Friday, 15 January 2021 at 17:02:32 UTC, Jack wrote: is this possible? if so, how? You can add extra options for for platform and compiler, and IIRC for build type too. For example like this for lflags, it might complain about the order so just follow the instructions. "lflags-debug"

Re: Why doesn't this work when the function is a static method?

2021-01-14 Thread evilrat via Digitalmars-d-learn
On Thursday, 14 January 2021 at 05:44:43 UTC, Jack wrote: On Wednesday, 13 January 2021 at 17:21:23 UTC, Paul Backus wrote: Member functions (including static ones) can't be called with UFCS. is this documented somewhere? Is this going to change? It will stay as is. It is somewhat

Re: How to debug D on Linux

2021-01-13 Thread evilrat via Digitalmars-d-learn
if you are looking for back trace someone recently posted a hint for linux where there is no back trace by default is to import core.sys.linux.backtrace or something that has back trace info and using it in exception handler for runtime to print the stack trace.

Re: Collections in D

2021-01-13 Thread evilrat via Digitalmars-d-learn
On Wednesday, 13 January 2021 at 12:06:05 UTC, Roguish wrote: What about sets? There is no specific set container, they just implemented as generic algorithms over the ranges. There is a section for set operations (std.algorithm.setops module). https://dlang.org/phobos/std_algorithm.html

Re: How build DCD on Windows?

2021-01-11 Thread evilrat via Digitalmars-d-learn
On Tuesday, 12 January 2021 at 00:35:41 UTC, Marcone wrote: Hi, Someone can Help me build exe dcd server and client on WIndows? Step by step? Becouse the informations disponible is very hard to undestand. Are you serious? It's on the first page of their repo under the Setup section

Re: Developing and running D GUI app on Android

2021-01-11 Thread evilrat via Digitalmars-d-learn
On Monday, 11 January 2021 at 07:38:00 UTC, Elronnd wrote: On Monday, 11 January 2021 at 06:26:41 UTC, evilrat wrote: Android itself is just linux under the hood, however the launcher starts java process that fires up your activity class (main in native languages) from there you just call your

Re: Developing and running D GUI app on Android

2021-01-10 Thread evilrat via Digitalmars-d-learn
On Sunday, 10 January 2021 at 18:58:13 UTC, aberba wrote: I'm looking to explore running a D application on Android based on Adams previous foundation work. However, I'm not familiar with the Android + D integration so I need some help. Has any of you successfully done that? Could use a

Re: C++ or D?

2020-12-23 Thread evilrat via Digitalmars-d-learn
On Wednesday, 23 December 2020 at 18:03:56 UTC, frame wrote: It's not the problem mentioned but I had to struggle with DLLs and D's Variant-type. The problem is that Variant uses TypeInfo which does not pass DLL boundaries correctly so that int != int in runtime even it's in fact a simple

Re: Getting started with graphqld

2020-12-17 Thread evilrat via Digitalmars-d-learn
On Tuesday, 15 December 2020 at 16:25:29 UTC, Trustee wrote: connect a basic vibe-d app to a graphql backend. umm, what? Did you mean write graphql backend using vibe.d?

Re: Iterating chars by Word

2020-11-12 Thread evilrat via Digitalmars-d-learn
On Friday, 13 November 2020 at 05:14:08 UTC, Виталий Фадеев wrote: Is: wchar[] chars; // like a: "import core.sys.windows.windows;\nimport std.conv : to;\n" Goal: foreach ( word; chars.byWord ) { // ... } You can make your own range, however look at this function first (second

Re: Getting Qte5 to work

2020-10-28 Thread evilrat via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 11:46:02 UTC, Josh Dredge wrote: Hi all, I'm completely new to D and while I'm not new to programming in general, I mostly do web development, Welcome! If by web development you also have back-end programming then you should be like 50% know how desktop

Re: How to compile Windows exe files from this source

2020-08-09 Thread evilrat via Digitalmars-d-learn
On Sunday, 9 August 2020 at 19:04:07 UTC, Marc wrote: I don't know much more about D than creating a 'hello world' exe file with the DMD Compiler but I'm interested in using the eBay/tsv-utils binaries. Unfortunately, the author didn't create any MS Windows binaries:

Re: Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

2020-07-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 July 2020 at 09:34:35 UTC, zoujiaqing wrote: I changed string to basic_string. /// source/main.d import std.stdio; import core.stdcpp.string; extern(C++) { class Canvas { @disable this(); static Canvas Create(); basic_string!ubyte Foo();

Re: Does std.net.curl: download have support for callbacks?

2020-06-11 Thread evilrat via Digitalmars-d-learn
On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote: I would like to set a callback for the `download()` function but I do not seem to find a way to add a callback to the procedure. Let's say, for example I have a GtkD Widget called "pb" (short for progressBar). I want to download a

Re: Interfacing with C++ std::shared_ptr and std::unique_ptr

2020-06-10 Thread evilrat via Digitalmars-d-learn
On Wednesday, 10 June 2020 at 06:43:24 UTC, Andre Pany wrote: Also, the C++ classes make use of templates. Is it still possible to call these classes from D? It should be, I did something similar and it worked. But it was quite some time ago so I don't remember exact situation and any

Re: `this` template params for struct not expressing constness.

2020-06-08 Thread evilrat via Digitalmars-d-learn
On Monday, 8 June 2020 at 07:35:12 UTC, adnan338 wrote: Hi, as far as I understand, the `this` template parameter includes constness qualifiers as seen in https://ddili.org/ders/d.en/templates_more.html To apply this I have this following struct: module bst; struct Tree(T) { T item;

Re: Linker error under Ubuntu

2020-05-15 Thread evilrat via Digitalmars-d-learn
On Friday, 15 May 2020 at 23:49:37 UTC, solidstate1991 wrote: Dub should do the linking by itself. How does it know what to link?

Re: Linker error under Ubuntu

2020-05-14 Thread evilrat via Digitalmars-d-learn
On Thursday, 14 May 2020 at 16:09:16 UTC, solidstate1991 wrote: When I try to compile my own project under Ubuntu with dub, I get the following linker error: /usr/bin/ld: .dub/obj/pixelperfectengine_pixelperfecteditor.o: undefined reference to symbol 'inflateEnd'

Re: Can I use Dlang in Qt5 instead C++ for develop Android Apps?

2020-04-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 April 2020 at 21:01:50 UTC, Baby Beaker wrote: I want develop Android apps using Qt5. But C++ is very hard. I want to use Dlang becouse Dlang is very easy. In theory nothing stops you from doing that. In practice however you have to deal with C++ anyway, how API matches ABI, and

Re: Is it possible to store different subclasses in one array?

2020-04-12 Thread evilrat via Digitalmars-d-learn
On Monday, 13 April 2020 at 04:21:48 UTC, Leonardo wrote: foreach (ref gi; GameItems) { if (gi == Weapon) gi.Attack() } How would it be? Replying myself... weapon = cast(Weapon) gi; if (weapon !is null) weapon.Attack() can be simplified as: if (auto weapon =

Re: Link error undefined symbol: __imp__InterlockedIncrement@4 on windows

2020-04-10 Thread evilrat via Digitalmars-d-learn
On Thursday, 9 April 2020 at 14:07:10 UTC, Clayton Alves wrote: I'm trying to compile my first hello world dub project, but when I run "dub" it spits this error: lld-link: error: undefined symbol: __imp__InterlockedIncrement@4 Does anybody have any clues what is going on ? This is from

Re: A question about C++ interop

2020-03-28 Thread evilrat via Digitalmars-d-learn
On Saturday, 28 March 2020 at 19:14:38 UTC, YD wrote: Hi, now I have a further question: when the C++ class A actually has a method that looks like virtual void get_info(std::string ) const = 0; in order to preserve the virtual function table layout (I found that if I omit this

Re: dub libs from home directory on windows

2020-03-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 19:53:58 UTC, jmh530 wrote: On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев wrote: On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: I cannot build my app, so I was wondering if there is some clever way to solve this without hardcoded path to

Re: AA code 50x slower

2020-02-16 Thread evilrat via Digitalmars-d-learn
On Monday, 17 February 2020 at 02:18:15 UTC, AlphaPurned wrote: But the input to the AA is static, it never changes. I thought D would essentially treat it as a constant and compute it once? (I'm only using the AA in one place but it is in another template that is used twice. I can't

Re: AA code 50x slower

2020-02-16 Thread evilrat via Digitalmars-d-learn
On Sunday, 16 February 2020 at 12:57:43 UTC, AlphaPurned wrote: template AA(string[] S) { auto _do() { int[string] d; foreach(s; S) d[s] = 0; return d; } enum AA = _do; } My best guess is that enum arrays(except strings) and AA's are instantiated every time you access them.

Re: How the hell to split multiple delims?

2020-02-16 Thread evilrat via Digitalmars-d-learn
On Sunday, 16 February 2020 at 09:57:26 UTC, AlphaPurned wrote: 1>Test.d(31): error : template ... 1>Test.d(61): error : template ... 1>Test.d(66): error : cannot implicitly convert expression `l` of type `immutable(char)` to `string` 1>Test.d(31): error : template ... 1>Test.d(79): error :

Re: How to check that import module will succeed?

2019-07-26 Thread evilrat via Digitalmars-d-learn
On Friday, 26 July 2019 at 14:56:37 UTC, Andrey Zherikov wrote: Even without static if I get the same result: mixin template my_import(alias modName) { mixin("import " ~ modName ~ ";"); } mixin my_import!"mymod"; pragma(msg,fullyQualifiedName!(myfunc)); // Error: undefined identifier

Re: How to check that import module will succeed?

2019-07-26 Thread evilrat via Digitalmars-d-learn
On Friday, 26 July 2019 at 03:42:58 UTC, Andrey Zherikov wrote: Is there a way to check whether some module, say "foo", is available for import before doing "import foo"? I did some really retarded utility like this in the past, worked for me, but I can't say it is that well tested and there

Re: Wrong vtable for COM interfaces that don't inherit IUnknown

2019-07-15 Thread evilrat via Digitalmars-d-learn
On Monday, 15 July 2019 at 22:01:25 UTC, KytoDragon wrote: I am currently trying to write a XAudio2 backend and have come across the problem, that some of the interfaces for XAudio2's COM objects seem to be missing the first entry in their vtable. After reading the iterface article in the spec

Re: Heterogeneous Variadic Arguments with Other Arguments

2019-07-14 Thread evilrat via Digitalmars-d-learn
On Sunday, 14 July 2019 at 03:51:14 UTC, harakim wrote: I wanted to do this: package int serialize(byte[] destination, int offset, T...)(T values) Can't really tell what's going on without call site and what do you exactly mean by "heterogeneous arguments with other arguments", but

Re: question about call cpp class constructer without new , and define cpp delegate

2019-06-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 27 June 2019 at 17:00:01 UTC, Rémy Mouëza wrote: I though support for C++ allocation had improved. In a recent release, there was the addition of core.stdcpp.new, but I didn't try it out: - http://dpldocs.info/experimental-docs/core.stdcpp.new_.html -

Re: question about call cpp class constructer without new , and define cpp delegate

2019-06-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 27 June 2019 at 05:37:08 UTC, ChangLoong wrote: If I want call cpp class constructer without new method, is there a way to do that ? If what you really want is to actually allocate using C++ new operator from D, then that is very problematic and not portable even across

Re: How can I override the defeat compiler select by Dub?

2019-06-23 Thread evilrat via Digitalmars-d-learn
On Sunday, 23 June 2019 at 23:10:48 UTC, Mike Brockus wrote: If you never seen Meson before then pick up a camera and take a picture: 樂  https://mesonbuild.com/ Nope. Wasn't working on Windows last time I checked. Hometown Meson user here simply just wondering how can I tell Dub to use

Re: Using python in D

2019-06-09 Thread evilrat via Digitalmars-d-learn
On Sunday, 9 June 2019 at 03:42:23 UTC, rnd wrote: Thanks for guidance. I also wanted to know: Once executable is successfully created, will it work on systems where Python and pandas are not installed? That is unlikely. PyD is just a D package, it doesn't have the ability to mess up with

Re: 1 - 17 ms, 553 ╬╝s, and 1 hnsec

2019-05-18 Thread evilrat via Digitalmars-d-learn
On Thursday, 16 May 2019 at 15:19:03 UTC, Alex wrote: 1 - 17 ms, 553 ╬╝s, and 1 hnsec fancy useless asci hieroglyphic Holy shirt! All that time I was thinking this is just some sort of encoding artifacts in terminal(common problem on windows), especially because IIRC on Linux it is

Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 21:29:18 UTC, Danny Arends wrote: "ImportError: No module named 'stuff'" How do I make the py_import file from pyd find the stuff.py file ? On Linux PYTHONPATH doesn't have current directory by default, so a hacky way to do it is to add it to PYTHONPATH prior to

Re: C Style char**

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 09:24:34 UTC, Doug Clayton wrote: Hi All, First time poster :) I'm working on getting a binding to Vulkan working properly in D, but I've run into a roadblock. The good news is that the binding seems to work fine, but I'm having an issue getting a parameter that

Re: is there a way to embed python 3.7 code in D program?

2019-05-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 03:06:07 UTC, evilrat wrote: https://github.com/Superbelko/pyd-min Here. Super minimal example, ptvsd can be commented out as well, it is there entirely for debugging. Pardon me, somehow I was completely misread the original question... Well, maybe someone else

Re: is there a way to embed python 3.7 code in D program?

2019-05-12 Thread evilrat via Digitalmars-d-learn
On Monday, 13 May 2019 at 01:35:58 UTC, evilrat wrote: I have project using pyd with python 3.7, that also using ptvsd (visual studio debugger for python package) to allow mixed debugging right inside VS Code. I'll reduce the code and upload somewhere later.

Re: is there a way to embed python 3.7 code in D program?

2019-05-12 Thread evilrat via Digitalmars-d-learn
On Sunday, 12 May 2019 at 22:36:43 UTC, torea wrote: ok, I'll do some more tests with pyd then. And if I cannot get it to work, I'll have a look at the package! I have project using pyd with python 3.7, that also using ptvsd (visual studio debugger for python package) to allow mixed

Re: OT - Git training Lon/HK and book recommendation on taste in programming

2019-05-01 Thread evilrat via Digitalmars-d-learn
On Wednesday, 1 May 2019 at 09:51:01 UTC, Laeeth Isharc wrote: Second question. Lots of people these days start to program to solve their problems at work but they may never have been shown the basic principles of design, structuring and maintenance of their code. If I could give them one

Re: DLL creation fails with undefined symbol error

2019-04-26 Thread evilrat via Digitalmars-d-learn
On Friday, 26 April 2019 at 14:20:24 UTC, dokutoku wrote: Error: linking with LLD failed C:\ldc\bin\ldc2.exe failed with exit code 1. Ok, I have Visual Studio and SDKs installed so it works for me without touching anything else. In your case it is using lld linker instead, and I have no

Re: DLL creation fails with undefined symbol error

2019-04-26 Thread evilrat via Digitalmars-d-learn
On Friday, 26 April 2019 at 05:08:32 UTC, dokutoku wrote: I tried to build a DLL in a Windows 64bit environment. It works well if the compiler is DMD, but in the case of LDC, the build fails with a large number of undefined symbol errors. Is this a DUB or LDC bug? Or do I have to specify some

Re: Recommendations for best JSON lib?

2019-04-20 Thread evilrat via Digitalmars-d-learn
On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky (Abscissa) wrote: I only need to read arbitrary JSON data, no need for writing/(de)serialization. std.json is simple as pie. However IIRC it fails with trailing

Re: DlangUI print too small on retina screens

2019-04-13 Thread evilrat via Digitalmars-d-learn
On Saturday, 13 April 2019 at 12:00:30 UTC, Joel wrote: Thanks for the reply, but I looked it up, and couldn't work out what I can do. I want to try using the overrideScreenDPI trick. option 1 - using override DPI function: --- // your average hello world UIAppMain()

Re: DlangUI print too small on retina screens

2019-04-12 Thread evilrat via Digitalmars-d-learn
On Friday, 12 April 2019 at 08:39:52 UTC, Joel wrote: I got a new computer (another MacBook Pro, but this one has retina display), now I don't think I can use my main programs (done in DlangUI), without eye strain and having my head close to the screen. I noticed a lot of forked versions of

Re: use dll's

2019-03-16 Thread evilrat via Digitalmars-d-learn
On Saturday, 16 March 2019 at 15:13:15 UTC, ontrail wrote: On Saturday, 16 March 2019 at 14:18:07 UTC, Andre Pany wrote: On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote: hi, i created a program (windows) and 2 dll's. how do i use the 2 d-language dll's in a d-language program with

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-05 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 05:03:42 UTC, Mike Parker wrote: This has nothing to do with dub, so that’s the wrong place for it. The dmd for windows docs needs to make clear the distinction between the linkers and the differences in behavior, and point to the linked docs for options. I just

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-04 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 03:48:22 UTC, Mike Parker wrote: I stopped using WinMain with D a long time ago. It's not necessary. If you always use `main`, then both linkers will provide you with a console subsystem app by default. That's particularly useful during development. You can add a

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-04 Thread evilrat via Digitalmars-d-learn
On Monday, 4 March 2019 at 18:34:09 UTC, Robert M. Münch wrote: Hi, when compiling a minimal Windows GUI app (using WinMain()) and compiling it with DUB, the 32-bit x86 version is a character subsystem EXE (writeln works) and for x86_64 it's a GUI subsystem EXE (writeln doesn't work). Since

Re: how to pass a malloc'd C string over to be managed by the GC

2019-02-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 February 2019 at 04:26:47 UTC, Sam Johnson wrote: Update: it seems that all I need to do is GC.addRoot(output); and memory leak goes away. I think I have answered my own question. If you know what you are doing. Otherwise you just postpone troubles due to mixed

Re: Setup help?

2019-02-06 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 23:59:07 UTC, Charles wrote: I don't use C++, and I do use Windows, which has me wondering if I'm just missing some normal/exepcted configuration. My most recent attempt I tried to get Native Debug to make VS Code debugging stop on the first line. Instead,

Re: C++ base class needs at least one virtual method

2019-02-06 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 February 2019 at 07:38:04 UTC, ezneh wrote: Thanks for the trick, I'll try it and see how it goes. Since the class have nothing in them, I just made some "alias otherclass = baseclass" statements and it seems it is working (at least it's compiling, have to really test that

Re: C++ base class needs at least one virtual method

2019-02-05 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 February 2019 at 14:23:00 UTC, ezneh wrote: Hello While trying to make a 1:1 binding to a C/C++ lib, I got the following issue: I only have access to the .h header file, and in there I have this: class someclass {}; class otherclass : public someclass {}; When trying to

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-18 Thread evilrat via Digitalmars-d-learn
On Friday, 18 January 2019 at 09:39:31 UTC, John Burton wrote: On Thursday, 17 January 2019 at 01:43:42 UTC, SrMordred wrote: struct Config { string title; int width; } struct Window { this(Config config) It likely is a bad idea for a small struct like this but if it

Re: How may I tell dub where to find a C library for linking?

2018-12-09 Thread evilrat via Digitalmars-d-learn
On Monday, 10 December 2018 at 02:59:21 UTC, Pablo De Nápoli wrote: On my system (Debian GNU/Linux 9, 64 bits) the library is in the directory /usr/lib/llvm-6.0/lib/ $ ls -l /usr/lib/llvm-6.0/lib/libLLVM.so lrwxrwxrwx 1 root root 14 oct 24 19:44 /usr/lib/llvm-6.0/lib/libLLVM.so ->

Re: DirectXMath alternative

2018-12-05 Thread evilrat via Digitalmars-d-learn
On Wednesday, 5 December 2018 at 10:52:44 UTC, Guillaume Piolat wrote: On Wednesday, 5 December 2018 at 01:57:53 UTC, evilrat wrote: On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative

Re: DirectXMath alternative

2018-12-04 Thread evilrat via Digitalmars-d-learn
On Tuesday, 4 December 2018 at 20:41:54 UTC, Guillaume Piolat wrote: On Tuesday, 4 December 2018 at 20:33:07 UTC, John Burton wrote: What is the best alternative for D, assuming there is anything? (I want vector, matrix math for use in D3, things like inverting a matrix, getting perspective

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 13:09:24 UTC, Andrey wrote: On Monday, 13 August 2018 at 13:05:28 UTC, evilrat wrote: however the best option is simply avoid naming anything with same name as module. Hmm, I thought that name of class should match name of file... And how to name a file that

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 12:44:44 UTC, evilrat wrote: Another option to save up on typing is renamed imports import mc = MyClass; mc.MyClass.parse(...) this also should work import mc = MyClass; alias MyClass = mc.MyClass; // make synonym // now it is just MyClass

Re: Importing struct

2018-08-13 Thread evilrat via Digitalmars-d-learn
On Monday, 13 August 2018 at 12:34:25 UTC, Andrey wrote: Hello, This is my test project: source/app.d source/MyClass.d app.d: import std.stdio; import MyClass; void main(string[] args) { MyClass.MyClass.parse(args); // I want just

Re: Windows 64-bit import library

2018-07-20 Thread evilrat via Digitalmars-d-learn
On Friday, 20 July 2018 at 04:31:38 UTC, Jordan Wilson wrote: On Friday, 20 July 2018 at 01:34:39 UTC, Mike Parker wrote: On Thursday, 19 July 2018 at 21:43:35 UTC, Jordan Wilson wrote: Is there any way I can generate the appropriate lib? Else I think I'll need to get hold of the proper

Re: Is there any tool that will auto publish my changes.

2018-07-16 Thread evilrat via Digitalmars-d-learn
On Sunday, 15 July 2018 at 00:25:22 UTC, Venkat wrote: I am writing a simple vibe.d app. The following is what I do right now. - I make changes. - build - Restart the server. Is there any tool that will auto publish my changes as I save them ? I am using Visual Studio Code. Thanks Venkat

Re: how to compile D programs without console window

2018-07-14 Thread evilrat via Digitalmars-d-learn
On Saturday, 14 July 2018 at 09:43:48 UTC, Flaze07 wrote: On Saturday, 14 July 2018 at 09:39:21 UTC, rikki cattermole wrote: If you're using dub, throw them into lflags and remove the -L. https://forum.dlang.org/post/gmcsxgfsfnwllploo...@forum.dlang.org hmm, for some unknown reason it says

Re: Create D binding for C struct containing templated class

2018-06-29 Thread evilrat via Digitalmars-d-learn
On Friday, 29 June 2018 at 06:04:10 UTC, Andre Pany wrote: Thanks a lot for the great help. You are right, until now I haven't looked at the include folder, I thought the "surface" folder is the folder with the public api. But it seems also in the include folder, the header files contains

Re: Create D binding for C struct containing templated class

2018-06-28 Thread evilrat via Digitalmars-d-learn
On Thursday, 28 June 2018 at 18:43:11 UTC, Andre Pany wrote: Hi, I try to write a binding for the GRPC core. There is a struct which has some ugly fields: (https://github.com/grpc/grpc/blob/master/src/core/lib/surface/call.cc#L229) struct grpc_call { gpr_refcount ext_ref; gpr_arena*

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Sunday, 10 June 2018 at 01:35:40 UTC, cc wrote: On Saturday, 9 June 2018 at 14:11:13 UTC, evilrat wrote: However steam devs decided to shield actual pointer and return pointer sized integer when C API is used(or they just screw up?). Anyway, the pointers for subsystems returned by context

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-09 Thread evilrat via Digitalmars-d-learn
On Saturday, 9 June 2018 at 03:14:13 UTC, cc wrote: On Saturday, 9 June 2018 at 03:07:39 UTC, cc wrote: I've put together a simplified test program here (124KB): Here is a pastebin of the D source file updated with some additional comments at the end with the callback class definitions from

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 08:06:27 UTC, Arafel wrote: On Thursday, 7 June 2018 at 13:07:21 UTC, evilrat wrote: I don't think so. It clearly states that children must mixin too, which can mean it just grabs symbols in scope only, and base class has no way of knowing about its subclasses. It

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 06:59:51 UTC, cc wrote: On Friday, 8 June 2018 at 02:52:10 UTC, Mike Parker wrote: On Friday, 8 June 2018 at 00:55:35 UTC, cc wrote: class CImpl : CCallbackBase { extern(C++) { If anyone has any insight to provide it would be greatly appreciated, thanks!

Re: Passing C++ class to DLL for callbacks from D (Steam)

2018-06-08 Thread evilrat via Digitalmars-d-learn
On Friday, 8 June 2018 at 00:55:35 UTC, cc wrote: I've defined it in D, as per https://dlang.org/spec/cpp_interface.html#classes : change this to class, or even abstract class as shown in example extern(C++) { interface CCallbackBase { //this() { m_nCallbackFlags

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-07 Thread evilrat via Digitalmars-d-learn
On Thursday, 7 June 2018 at 12:32:26 UTC, Arafel wrote: Thanks for all the answers! Is it possible to register, say, a base class, and have all the subclasses then registered automatically? My idea would be to make it as transparent as possible for the plugin implementation, and also not

Re: Runtime introspection, or how to get class members at runtime Fin D

2018-06-07 Thread evilrat via Digitalmars-d-learn
On Wednesday, 6 June 2018 at 13:28:02 UTC, Arafel wrote: I know it might not be the most idiomatic D, but as somebody with mostly a Java background (with some C and just a bit of C++) it seems something really straightforward to me: myObject.getClass().getFields() [2]. Also, I know I could

Re: Making an .exe that executes source file inside itself.

2018-04-27 Thread evilrat via Digitalmars-d-learn
On Thursday, 26 April 2018 at 10:06:57 UTC, JN wrote: On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: Alternatively, I don't know about specifics how to implement it in D, but the key phrase you are looking for is "code hotswap" or "hot loading". It's being popularized right now in

Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: Modify example.cpp to: == // example.cpp #include "example.h" namespace SomeApi {} struct SomeStruct {} void call_cpp() { foo("do great things"); return; }

Re: COM/OLE advanced questions

2017-11-02 Thread evilrat via Digitalmars-d-learn
You'd better read some more authorative source since my experience is very limited on that matter, but here is some quick notes On Thursday, 2 November 2017 at 14:22:56 UTC, Guillaume Piolat wrote: Question 1. Is it mandatory to inherit from core.sys.windows.unknwn.IUnknown, or just having

Re: dub optional dependency

2017-10-28 Thread evilrat via Digitalmars-d-learn
On Saturday, 28 October 2017 at 19:23:42 UTC, ikod wrote: So default version is "std", I can build it w/o vibe-d, but dub anyway fetch vibe-d. I'd like dub fetch vibe-d only when I build with --config vibed. I know about "optional": true, it prevent dub to fetch vibe-d for "std" config,

Re: debugging in vs code on Windows

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 07:57:25 UTC, Dmitry wrote: On Tuesday, 17 October 2017 at 10:09:12 UTC, Dmitry wrote: On Tuesday, 17 October 2017 at 08:38:20 UTC, Arjan wrote: Before this will work, one must install the Microsoft C/C++ Addin i.e. ms-vscode.cpptools. Start debugging and

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:22:09 UTC, Andrea Fontana wrote: On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: You can write your script in D using #!/usr/local/bin/rdmd as shebang line. Or, using dstep, you can convert C headers to D imports, so you can compile your

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 08:15:53 UTC, evilrat wrote: ... extern(C) static int test_builtin(WORD_LIST* list) ... This of course should be nothrow also, because if it throws something really bad may(will) happen

Re: Writing some built-in functions for Bash, possible?

2017-10-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 October 2017 at 03:48:01 UTC, Ky-Anh Huynh wrote: Hi, I'm using Bash heavily in my systems. Things become slow and slow when I have tons of scripts :) And sometimes it's not easy to manipulate data. You may have heard of recutils [1] which has a C extension to be loaded by

Re: Can't use function with same name as module?

2017-10-17 Thread evilrat via Digitalmars-d-learn
On Tuesday, 17 October 2017 at 06:13:45 UTC, Shriramana Sharma wrote: Hello. fun.d: import std.stdio; void fun() { writeln("Hello"); } main.d: import fun; void main() { fun(); } $ dmd -oftest fun.d main.d main.d(2): Error: function expected before (), not module fun of type void Why can't

Re: How to embed static strings to a D program?

2017-10-16 Thread evilrat via Digitalmars-d-learn
On Monday, 16 October 2017 at 05:34:13 UTC, Ky-Anh Huynh wrote: Hello, I want to use some static contents in my program, e.g, a CSS file, a long listing. To help deployment process I'd like to have them embedded in the final binary file. Is there any convenient way to support this? Maybe I

Re: Why isn't IID_ITaskbarList3 defined?

2017-10-15 Thread evilrat via Digitalmars-d-learn
On Sunday, 15 October 2017 at 15:13:09 UTC, Nieto wrote: I'm trying to write a blinding and I found both IID_ITaskbarList and IID_ITaskbarList2 are defined but IID_ITaskbarList3 isn't. Any reason why it isn't defined? sorry if it sounds such a naive question, I'm new to COM and D interop. I

Re: debugging in vs code on Windows

2017-10-14 Thread evilrat via Digitalmars-d-learn
On Saturday, 14 October 2017 at 07:40:31 UTC, piotrklos wrote: On Friday, 13 October 2017 at 17:04:00 UTC, kerdemdemir wrote: On Friday, 13 October 2017 at 12:55:09 UTC, piotrklos wrote: (...) I am using VisualD(https://github.com/dlang/visuald/releases) with vs2015 community version(free)

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 18:51:43 UTC, ParticlePeter wrote: On Monday, 22 May 2017 at 14:01:56 UTC, Jerry wrote: IIRC the problem is that it isn't a POD type. ImVec2 has its own default constructor. The problem now is that because it no longer is POD, Window's ABI handles it different and

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 11:25:31 UTC, ParticlePeter wrote: Then I am not getting your hack, this function here, does not exist on the C++ side. HACK --- // extern(C++) of course void GetCursorPos(ImVec2* v); How is it supposed to work then if there is no

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 08:03:07 UTC, ParticlePeter wrote: No, no, this (other) way around :-), still C++ to D. It actually works btw: HACK --- // original C++ ImVec2 GetCursorPos(); // C++ helper void GetCursorPos(ImVec2& result) { result = GetCursorPos(); }

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-22 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 06:33:37 UTC, ParticlePeter wrote: On Monday, 22 May 2017 at 01:39:04 UTC, evilrat wrote: And this is actually D problem. In fact first bug report on this thing was dated back to 2014. Still not fixed. Thanks for your reply, do you have any links to some bug

Re: C++ binding issues with C++ function returning a simple POD struct.

2017-05-21 Thread evilrat via Digitalmars-d-learn
On Monday, 22 May 2017 at 01:27:22 UTC, Nicholas Wilson wrote: On Sunday, 21 May 2017 at 19:33:06 UTC, ParticlePeter wrote: I am statically linking to ImGui [1] on Win 10 x64, quite successfully till this issue came up. The noticed error so far comes when an ImGui function returns an ImVec2, a

<    1   2   3   >