Re: ImportC: unresolved external symbol
On Tuesday, 14 June 2022 at 14:38:17 UTC, Mike Parker wrote: On Tuesday, 14 June 2022 at 14:32:50 UTC, ryuukk_ wrote: ``` nk.obj : error LNK2019: unresolved external symbol test referenced in function _Dmain ``` Am i missing something important? (that is a dub project, created with: dub init) DMD: v2.100.0-dirty This works from the command line: ``` dmd -m64 app.d nk.c ``` It's possible dub isn't passing the C file to the compiler. That was the issue! Adding the file manually in the dub.json solved it! ``` "sourceFiles": [ "source/nk.c" ] ``` That should be easy to fix, i'll fill a PR Thanks
Re: ImportC: unresolved external symbol
On Tuesday, 14 June 2022 at 14:32:50 UTC, ryuukk_ wrote: ``` nk.obj : error LNK2019: unresolved external symbol test referenced in function _Dmain ``` Am i missing something important? (that is a dub project, created with: dub init) DMD: v2.100.0-dirty This works from the command line: ``` dmd -m64 app.d nk.c ``` It's possible dub isn't passing the C file to the compiler. Assuming everything's configured properly (e.g., both files are in the same source directory, or the paths are properly set if they aren't), you should do a verbose build and see what the compiler command line looks like.