Re: Applied fix to Dub (Was: ImportC in a Dub project )

2022-10-30 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 30 October 2022 at 14:42:55 UTC, Carsten Schlote wrote: On Sunday, 30 October 2022 at 13:38:23 UTC, Imperatorn wrote: [...] I will merge the two PRs into a new patchset, and also add appropriate code to search für {c|i|h} files at the right places. The patchset should be as

Re: Applied fix to Dub (Was: ImportC in a Dub project )

2022-10-30 Thread Carsten Schlote via Digitalmars-d-learn
On Sunday, 30 October 2022 at 13:38:23 UTC, Imperatorn wrote: On Sunday, 30 October 2022 at 12:46:10 UTC, Carsten Schlote wrote: It turned out, that the required changes to add support for C files in Dub are really small. So I added a PR (https://github.com/dlang/dub/pull/2521). There is also

Re: Applied fix to Dub (Was: ImportC in a Dub project )

2022-10-30 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 30 October 2022 at 12:46:10 UTC, Carsten Schlote wrote: It turned out, that the required changes to add support for C files in Dub are really small. So I added a PR (https://github.com/dlang/dub/pull/2521). There is also some other PR (https://github.com/dlang/dub/pull/2270)

Applied fix to Dub (Was: ImportC in a Dub project )

2022-10-30 Thread Carsten Schlote via Digitalmars-d-learn
It turned out, that the required changes to add support for C files in Dub are really small. So I added a PR (https://github.com/dlang/dub/pull/2521). There is also some other PR (https://github.com/dlang/dub/pull/2270) releated to C file support in Dub. With my PR (2521) applied I can now

Re: ImportC in a Dub project

2022-10-30 Thread Carsten Schlote via Digitalmars-d-learn
On Friday, 28 October 2022 at 19:08:47 UTC, Steven Schveighoffer wrote: By default dub does not build C files (as evidenced by your command line). It may not even let you I don't know, but try: ```json "sourceFiles" : ["source/zstdc_binding.c"] ``` Ok, this works. So Dub is not picking any

Re: ImportC in a Dub project

2022-10-28 Thread Imperatorn via Digitalmars-d-learn
On Friday, 28 October 2022 at 19:04:21 UTC, Carsten Schlote wrote: On Friday, 28 October 2022 at 18:56:03 UTC, Imperatorn wrote: Like schveiguy said, what's your build line? dmd should pick up the file if the import has the same name as the file. What do you mean with 'buildline'? The project

Re: ImportC in a Dub project

2022-10-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/28/22 2:43 PM, Carsten Schlote wrote: On Friday, 28 October 2022 at 18:31:25 UTC, Steven Schveighoffer wrote: Are you passing the c file to the compiler? Also, you must be using dmd for ImportC currently. What is your build line? ``` $ cat dub.json { "authors": [    

Re: ImportC in a Dub project

2022-10-28 Thread Carsten Schlote via Digitalmars-d-learn
On Friday, 28 October 2022 at 18:56:03 UTC, Imperatorn wrote: Like schveiguy said, what's your build line? dmd should pick up the file if the import has the same name as the file. What do you mean with 'buildline'? The project is build with dub. See previous posts with outputs from

Re: ImportC in a Dub project

2022-10-28 Thread Imperatorn via Digitalmars-d-learn
On Friday, 28 October 2022 at 18:43:21 UTC, Carsten Schlote wrote: On Friday, 28 October 2022 at 18:31:25 UTC, Steven Schveighoffer wrote: [...] ``` $ cat dub.json { "authors": [ "Carsten Schlote" ], "copyright": "Copyright © 2022, Carsten Schlote",

Re: ImportC in a Dub project

2022-10-28 Thread Carsten Schlote via Digitalmars-d-learn
On Friday, 28 October 2022 at 18:31:25 UTC, Steven Schveighoffer wrote: Are you passing the c file to the compiler? Also, you must be using dmd for ImportC currently. What is your build line? ``` $ cat dub.json { "authors": [ "Carsten Schlote" ],

Re: ImportC in a Dub project

2022-10-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/28/22 1:45 PM, Carsten Schlote wrote: Hi, I created a Dub project containing two files: app.d and zstd_binding.c ``` $ cat source/zstd_binding.c #include #include #include void relatedCode(void) { printf("Hallo! This is some output from C code!\n"); } ``` and ``` $ cat

Re: ImportC in a Dub project

2022-10-28 Thread Carsten Schlote via Digitalmars-d-learn
On Friday, 28 October 2022 at 17:56:57 UTC, Imperatorn wrote: On Friday, 28 October 2022 at 17:45:59 UTC, Carsten Schlote wrote: Hi, I created a Dub project containing two files: app.d and zstd_binding.c [...] Are you using DMD? I'm using ``` $ dub --version DUB version 1.29.2, built on

Re: ImportC in a Dub project

2022-10-28 Thread Imperatorn via Digitalmars-d-learn
On Friday, 28 October 2022 at 17:45:59 UTC, Carsten Schlote wrote: Hi, I created a Dub project containing two files: app.d and zstd_binding.c [...] Are you using DMD?

ImportC in a Dub project

2022-10-28 Thread Carsten Schlote via Digitalmars-d-learn
Hi, I created a Dub project containing two files: app.d and zstd_binding.c ``` $ cat source/zstd_binding.c #include #include #include void relatedCode(void) { printf("Hallo! This is some output from C code!\n"); } ``` and ``` $ cat source/app.d import std.conv; import std.stdio;