How to link to packages in static libraries using Visual D -
I am using VisualD and DMD to write D in Visual Studio 2012.
My solution looks like this in Solution Explorer:
ConsoleApp1 (name of the solution) - codecmable (a static D library) - - http (folder) - - - Package D - - - Request D - Malacca (console project) - - Main D
codecrambl
My static D library codecramlib
The building on the right is the source here:
package.d
module codecramlib.http; Public import request;
request.d
module requests; // Temporary filler code class request {public int imaraequest () {return 13; }}
When I right click on codecramlib
and get this output in the console vs.
- - --- Start construction: Project: codecramlib, Configuration: Debug Win32 ------ Building Debug \ codecramlib.lib ... ========= Build: 1 succeeded, 0 failed, 0 Up-to-date, 0 skip ==========
Malkai (main project)
main D:
Import std.stdio; Import codecramlib.http; // also tried import codecramlib; Int main (string [] argv) {writeln ("Hello D-World!"); Return 0; }
I click on the codecramlib
project on the malachai
project and select Properties> Configuration Properties> Compiler> Normal and select the form of a malicious dependency Modify the "Additional Import" field to read and read "../codecramlib". Then I click on 'apply' and 'okay'.
When I right click on Malachai
in Solution Explorer and click on Build, I get this error:
error Error 1: The module is in the 'codecramlib \ http.d' file, which can not be read C: \ Users \ & lt; Path removed & gt; First of all I had tried the "Extra Import" line from: Visual Studio 2012 \ Projects \ ConsoleApp1 \ malakai \ main.d 2
Troubleshooting
P>
../
This is because the build error changed: Error 1 error: The module request file contains 'request .d' can not be read Is: C: \ Users \ & lt; Path Extracted> \ Visual Studio 2012 \ Projects \ ConsoleApp1 \ codecramlib \ http \ package.d3
In an attempt to identify the request.d in the codecramlib
constant in the compiler. Library, I have changed the package.d to read:
module codecramlib.http; Public import http.request;
This one step was looking backwards because the codecramble library was no longer manufactured, and when I tried to make Malacca, I found these errors:
Error 1: The module request from the file http \ request.d should be imported as a 'request' C: \ Users \ & lt; Path removed & gt; \ Visual Studio 2012 \ Projects \ ConsoleApp1 \ codecramlib \ http \ package.d 3 Error 2: The module request file is in 'http \ request.d' which can not be read C: \ Users \ & lt; Path removed & gt; \ Visual Studio 2012 \ Projects \ ConsoleApp1 \ codecramlib \ http \ package.d 3
How do I use the codecramlib.http package in Visual C's codecramlib static library in my Malacai console Project with?
Editing
Corrected my folder structure as shown in the Solution Explorer PackageD and request.d My indentions were not correct.
Edit 2
Main D Content
= "post-text" itemprop = "text">
this part
../
It seems because Change in build error: Error 1 error: The module request file contains 'request.d' which can not be read C: \ Users \ & lt; Paths Removed> \ Visual Studio 2012 \ Projects \ ConsoleApp1 \ codecramlib \ http \ package.d3
I encourage you to believe that this is in your request module codecramlib.http package Do not know, and because of that DMD / codecramlib / http / request.d to see in.
I recommend leaving the "Additional Import" field as "../", and codecramlib / http / request.d to the module codecramlib.http.request
Replace with name. , And then make your import changes to codecramlib / http / package.d in public import codecramlib.http.request
.
In general, you would like to match your module names to the directory layout.
Comments
Post a Comment