On 26.05.2016 17:11, TheDGuy wrote:
Hi,
i use Visual D as a plugin for visual studio to create D applications.
But what bothers me a bit is that i have to tell visual D the exact link
to the .lib file for every lib i want to use in the project (!).
So these are the steps i have to make to get an external lib working:

1. create a new folder in D:\dmd2\src\ with the name of the library
2. edit the 'sc.ini' file in D:\dmd2\windows\bin\ and add
"-I%@P%\..\..\src\[foldername]" under '[Environment]' for every lib i
want to use
3. add the .lib file to D:\dmd2\windows\lib
4. add the path to the lib in visual studio (project properties ->
Linker -> General -> Library Files)

Why do i have to do that? Why can i not just use one folder for the
library files in visual d and the compiler searches the .lib files for
each library which was imported into the project on its own?

Is there an easier way to use libraries?

You don't have to change anything in sc.ini. Just add the import path (the folder with the source files of your library) to "Project properties -> Compiler -> Additional import paths" and the full path to the .lib file to "Library Files". If it contains spaces, use quotes.

If you want to use these libraries in multiple projects, you can also setup global search paths in "Tools -> Options -> Projects and Solutions -> Visual D Settings -> DMD directories".

Reply via email to