digitalmars.D.learn - Missing D files
- LorenDB (26/26) Dec 31 2020 I'm trying to learn D, but at the same time I'm trying to
- Steven Schveighoffer (4/33) Dec 31 2020 That's pretty old. std.c is now core.stdc
- Paul Backus (4/17) Dec 31 2020 This looks like a bug in Swig. The D module corresponding to the
- Adam D. Ruppe (5/8) Dec 31 2020 It used to be std.c.* many years ago, so it is probably just an
I'm trying to learn D, but at the same time I'm trying to generate a Qt binding for D (yes, yes, Qte5, but I don't like the dynamic loading of libraries that Qte5 uses). I know that this is probably a bad stage of the game to be making bindings, but... Anyway, I'm using Swig to create a wrapper for the Qt files. While creating the first wrapper (QObject), I ran across some errors: ``` Performing "debug" build using ldc2 for x86_64. qt5-d ~master: building configuration "application"... source/QtCore/QObject_im.d(51,19): Error: module string is in file 'std/c/string.d' which cannot be read import path[0] = source/ import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d import path[2] = /usr/include/d source/QtCore/QObject_im.d(121,14): Error: module linux is in file 'std/c/linux/linux.d' which cannot be read import path[0] = source/ import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d import path[2] = /usr/include/d ldc2 failed with exit code 1. ``` (This forum needs inline Markdown.) I have no idea where I'm supposed to get "std/c/linux/linux.d" and "std/c/string.d". I'm on Ubuntu 20.04 using the bundled ldc2 and corresponding libphobos. Any suggestions?
Dec 31 2020
On 12/31/20 10:01 AM, LorenDB wrote:I'm trying to learn D, but at the same time I'm trying to generate a Qt binding for D (yes, yes, Qte5, but I don't like the dynamic loading of libraries that Qte5 uses). I know that this is probably a bad stage of the game to be making bindings, but... Anyway, I'm using Swig to create a wrapper for the Qt files. While creating the first wrapper (QObject), I ran across some errors: ``` Performing "debug" build using ldc2 for x86_64. qt5-d ~master: building configuration "application"... source/QtCore/QObject_im.d(51,19): Error: module string is in file 'std/c/string.d' which cannot be read import path[0] = source/ import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d import path[2] = /usr/include/d source/QtCore/QObject_im.d(121,14): Error: module linux is in file 'std/c/linux/linux.d' which cannot be read import path[0] = source/ import path[1] = /usr/lib/ldc/x86_64-linux-gnu/include/d import path[2] = /usr/include/d ldc2 failed with exit code 1. ``` (This forum needs inline Markdown.) I have no idea where I'm supposed to get "std/c/linux/linux.d" and "std/c/string.d". I'm on Ubuntu 20.04 using the bundled ldc2 and corresponding libphobos. Any suggestions?That's pretty old. std.c is now core.stdc Swig may need some updating if it's generating links to that package. -Steve
Dec 31 2020
On Thursday, 31 December 2020 at 15:01:04 UTC, LorenDB wrote:I'm trying to learn D, but at the same time I'm trying to generate a Qt binding for D (yes, yes, Qte5, but I don't like the dynamic loading of libraries that Qte5 uses). I know that this is probably a bad stage of the game to be making bindings, but... Anyway, I'm using Swig to create a wrapper for the Qt files. While creating the first wrapper (QObject), I ran across some errors: ``` Performing "debug" build using ldc2 for x86_64. qt5-d ~master: building configuration "application"... source/QtCore/QObject_im.d(51,19): Error: module string is in file 'std/c/string.d' which cannot be readThis looks like a bug in Swig. The D module corresponding to the C header `string.h` is `core.stdc.string`, but it's trying to import it as `std.c.string`.
Dec 31 2020
On Thursday, 31 December 2020 at 15:54:58 UTC, Paul Backus wrote:The D module corresponding to the C header `string.h` is `core.stdc.string`, but it's trying to import it as `std.c.string`.It used to be std.c.* many years ago, so it is probably just an old converter. Probably an easy enough update if you have the source. Or just replace it in the generated files in a second pass.
Dec 31 2020
On Thursday, 31 December 2020 at 16:28:03 UTC, Adam D. Ruppe wrote:Or just replace it in the generated files in a second pass.Maybe that could be my first useful (ok, first non-"Hello world!") program in D.
Dec 31 2020
On Thursday, 31 December 2020 at 16:49:53 UTC, LorenDB wrote:On Thursday, 31 December 2020 at 16:28:03 UTC, Adam D. Ruppe wrote:So I've written a program that fixes these statements: https://github.com/LorenDB/modern-d-swig. It works fine and eliminates the error about C's string library; however, the problem is that the linux library error is still alive and kicking. I've looked around in the D include path and found that there isn't even a `linux.d` file (<= The markdown bug keeps getting me :D). Swig is trying to import `std.c.linux.linux`. My program changes that to `core.stdc.linux.linux`, which doesn't exist. There is a folder in the include path called "linux" that goes like this: `core/sys/linux/` but there isn't any linux.d file. Looking at the Swig-generated code, I think that I might be best off trying to import Linux's dll functions. Let me give it a go... ...and the Linux error is gone! I'll have to mark this one down for my modernizing app.Or just replace it in the generated files in a second pass.Maybe that could be my first useful (ok, first non-"Hello world!") program in D.
Dec 31 2020