On 12/03/2023 3:12 PM, idsize wrote:
I started learning D a few weeks ago and am enjoying it so far. I would like to use SDL with D and found bindbc-sdl, but I cannot figure out how to make it work.

Welcome!

From my understanding, I'll need to use 'dub fetch bindbc-sdl' to download it, and then run 'dub build bindbc-sdl' to build it, before I can use it. Fetching it works, but it always fails to build. I get this error: 'failed launching cl.exe /P /Zc:preprocessor /PD /nologo ... '.

You don't need to do that, add it as a dependency in your dub package and dub will do the rest.

But ugh that error looks weird. That would imply its trying to run the C preprocessor for ImportC. That does not sound right at all, I don't see any C headers/code in bindbc-sdl repo (not that it needs it). Gonna need to see the entire error log for that to know whats going on (and possibly the verbose output).

Additionally, a more general question about bindbc, is it possible to skip using dub altogether? Like would placing the bindbc files inside of 'C:\D\dmd2\src\druntime\import' work directly?

Yes, but not that way. Druntime/phobos are both distributed compiled, the import directories tell the compiler what has been compiled in and allow access to templates defined by the library (which you then compile).

If you add the appropriate versions and copy the files to your project directory (including bindbc-loader) that should work however as long as you compile it in.
  • Using bindbc-sdl... idsize via Digitalmars-d-learn
    • Re: Using b... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Usi... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... ryuukk_ via Digitalmars-d-learn
          • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Usi... idsize via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: Using b... ryuukk_ via Digitalmars-d-learn

Reply via email to