Thread overview
ImportC: Overriding standard search paths for C includes
Feb 28
kdevel
Feb 28
kinke
Mar 04
kdevel
February 28

Given the C source cmysql.c containing just

#include <mysql/mysql.h>

Assume on a Linux system there is not only

/usr/include/mysql/mysql.h        (1)

but also

/tmp/dummyinclude/mysql/mysql.h   (2)

In order to instruct gcc to include the second file I compile with

gcc -I /tmp/dummyinclude cmysql.c

Now I have a D file test.d containing only

import cmysql;

How do I get ImportC to include (2)? On my machine

dmd -I(=)/tmp/dummyinclude test.d

always lstats and opens /usr/include/mysql/mysql.h?

February 28

On Wednesday, 28 February 2024 at 07:13:35 UTC, kdevel wrote:

>
dmd -I(=)/tmp/dummyinclude test.d

With dmd -P=-I/tmp/dummyinclude test.d.

March 04

On Wednesday, 28 February 2024 at 12:18:38 UTC, kinke wrote:

>

On Wednesday, 28 February 2024 at 07:13:35 UTC, kdevel wrote:

>
dmd -I(=)/tmp/dummyinclude test.d

With dmd -P=-I/tmp/dummyinclude test.d.

Thanks, works.