Bug 24444 – ImportC: no way to specify where header files "live"

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-03-20T17:04:05Z
Last change time
2024-12-13T19:33:56Z
Keywords
ImportC
Assigned to
No Owner
Creator
Atila Neves
Moved to GitHub: dmd#18222 →

Comments

Comment #0 by atila.neves — 2024-03-20T17:04:05Z
This C file fails to compile with ImportC on my system: ------------------- #include <Python.h> ------------------- The reason why is that `Python.h` is in `/usr/include/python3.11`. There's no way to tell the compiler to look for headers in specific directories.
Comment #1 by dkorpel — 2024-03-20T17:56:42Z
There is the `-P=<preprocessorflag>` option: ``` dmd -P-I/usr/include/python3.11 ```
Comment #2 by atila.neves — 2024-03-20T18:07:52Z
I see. The -P flag doesn't show up in the man page.
Comment #3 by lance — 2024-03-20T18:34:26Z
To be honest, it's not that easy to find on this page either: https://dlang.org/spec/importc.html#manual-cpp Under "Running the Preprocessor Automatically" it says "The -Ppreprocessorflag switch passes preprocessorflag to the preprocessor." It's not even searchable using that wording.
Comment #4 by robert.schadek — 2024-12-13T19:33:56Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18222 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB