[Issue 24418] New: ImportC: can't import C file with fully qualified name if C file on the command line
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Wed Feb 28 08:22:06 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24418
          Issue ID: 24418
           Summary: ImportC: can't import C file with fully qualified name
                    if C file on the command line
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com
---------
// source/foo/bar/quux.c
int twice(int i) { return i * 2; }
// source/mod.d
import foo.bar.quux;
---------
% dmd -c -Isource source/mod.d # fine
% dmd -c -Isource source/mod.d source/foo/bar/quux.c
source/mod.d(1): Error: module `quux` from file source/foo/bar/quux.c must be
imported with 'import quux;'
It doesn't help that one can't explicitly declare the module name since quux.c
is a C file.
--
    
    
More information about the Digitalmars-d-bugs
mailing list