www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Visual D - Solution with Static Lib and Console App.

reply "Nekroze" <nekroze.lives gmail.com> writes:
Ok so I have the need to make a static library that will be 
reused in multiple future projects. My thinking was that in 
future solutions i can just add an existing project, my static 
library project, so it would grab it and just work. However i 
cannot seem to get it to work.

I have a solution with a console app and the static library at 
the moment and have made the console app have the static library 
as a dependency. under the project settings of the console app i 
cannot seem to disable using the "standard import paths" but even 
if i add the path to the standard import paths in the visual d 
settings it still doesn't work.

I could probably make this working by making my own sc.ini but 
that is something i would rather not do if i don't have to and i 
am sure there is a way of making this work.

Any help would be greatly appreciated!
Dec 06 2012
next sibling parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will be reused in
 multiple future projects. My thinking was that in future solutions i can
 just add an existing project, my static library project, so it would
 grab it and just work. However i cannot seem to get it to work.

 I have a solution with a console app and the static library at the
 moment and have made the console app have the static library as a
 dependency. under the project settings of the console app i cannot seem
 to disable using the "standard import paths" but even if i add the path
 to the standard import paths in the visual d settings it still doesn't
 work.

 I could probably make this working by making my own sc.ini but that is
 something i would rather not do if i don't have to and i am sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.
Dec 06 2012
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 06.12.2012 23:00, Nekroze wrote:
 On Thursday, 6 December 2012 at 21:28:38 UTC, Rainer Schuetze wrote:
 On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will be reused in
 multiple future projects. My thinking was that in future solutions i can
 just add an existing project, my static library project, so it would
 grab it and just work. However i cannot seem to get it to work.

 I have a solution with a console app and the static library at the
 moment and have made the console app have the static library as a
 dependency. under the project settings of the console app i cannot seem
 to disable using the "standard import paths" but even if i add the path
 to the standard import paths in the visual d settings it still doesn't
 work.

 I could probably make this working by making my own sc.ini but that is
 something i would rather not do if i don't have to and i am sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.

As i said in the OP i have done this but it still doesn't work. I think in Visual D all that changes is the build order etc. not the importing and linking by the looks of it.

It puts the output of the library project on the command line of the dependent project. Please check the build log or post it here.
Dec 06 2012
parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 06.12.2012 23:14, Nekroze wrote:
 On Thursday, 6 December 2012 at 22:06:43 UTC, Rainer Schuetze wrote:
 On 06.12.2012 23:00, Nekroze wrote:
 On Thursday, 6 December 2012 at 21:28:38 UTC, Rainer Schuetze wrote:
 On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will be reused in
 multiple future projects. My thinking was that in future solutions
 i can
 just add an existing project, my static library project, so it would
 grab it and just work. However i cannot seem to get it to work.

 I have a solution with a console app and the static library at the
 moment and have made the console app have the static library as a
 dependency. under the project settings of the console app i cannot
 seem
 to disable using the "standard import paths" but even if i add the
 path
 to the standard import paths in the visual d settings it still doesn't
 work.

 I could probably make this working by making my own sc.ini but that is
 something i would rather not do if i don't have to and i am sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.

As i said in the OP i have done this but it still doesn't work. I think in Visual D all that changes is the build order etc. not the importing and linking by the looks of it.

It puts the output of the library project on the command line of the dependent project. Please check the build log or post it here.

Thats what i have done, im not sure if its linking correctly because it cant even get past importing. On the note of linking it should just link it right i shouldnt have to put a pragma or specific command line arg extra in? https://dl.dropbox.com/u/27223793/demo.buildlog.html That is the link to the build log it just doesn't import.

Ah, I misunderstood, it's not a linking problem, but an import issue. You have to specify the path to the library sources (probably D:\Dropbox\Projects\edquizlib in your case) in the "Additional imports" setting of the project. There's been an enhancement request before to add this import path automatically to dependent projects, but it isn't always obvious from the file names only which path is the correct one.
Dec 06 2012
prev sibling next sibling parent "Nekroze" <nekroze.lives gmail.com> writes:
On Thursday, 6 December 2012 at 21:28:38 UTC, Rainer Schuetze 
wrote:
 On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will be 
 reused in
 multiple future projects. My thinking was that in future 
 solutions i can
 just add an existing project, my static library project, so it 
 would
 grab it and just work. However i cannot seem to get it to work.

 I have a solution with a console app and the static library at 
 the
 moment and have made the console app have the static library 
 as a
 dependency. under the project settings of the console app i 
 cannot seem
 to disable using the "standard import paths" but even if i add 
 the path
 to the standard import paths in the visual d settings it still 
 doesn't
 work.

 I could probably make this working by making my own sc.ini but 
 that is
 something i would rather not do if i don't have to and i am 
 sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.

As i said in the OP i have done this but it still doesn't work. I think in Visual D all that changes is the build order etc. not the importing and linking by the looks of it.
Dec 06 2012
prev sibling next sibling parent "Nekroze" <nekroze.lives gmail.com> writes:
On Thursday, 6 December 2012 at 22:06:43 UTC, Rainer Schuetze 
wrote:
 On 06.12.2012 23:00, Nekroze wrote:
 On Thursday, 6 December 2012 at 21:28:38 UTC, Rainer Schuetze 
 wrote:
 On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will be 
 reused in
 multiple future projects. My thinking was that in future 
 solutions i can
 just add an existing project, my static library project, so 
 it would
 grab it and just work. However i cannot seem to get it to 
 work.

 I have a solution with a console app and the static library 
 at the
 moment and have made the console app have the static library 
 as a
 dependency. under the project settings of the console app i 
 cannot seem
 to disable using the "standard import paths" but even if i 
 add the path
 to the standard import paths in the visual d settings it 
 still doesn't
 work.

 I could probably make this working by making my own sc.ini 
 but that is
 something i would rather not do if i don't have to and i am 
 sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.

As i said in the OP i have done this but it still doesn't work. I think in Visual D all that changes is the build order etc. not the importing and linking by the looks of it.

It puts the output of the library project on the command line of the dependent project. Please check the build log or post it here.

Thats what i have done, im not sure if its linking correctly because it cant even get past importing. On the note of linking it should just link it right i shouldnt have to put a pragma or specific command line arg extra in? https://dl.dropbox.com/u/27223793/demo.buildlog.html That is the link to the build log it just doesn't import.
Dec 06 2012
prev sibling parent "Nekroze" <nekroze.lives gmail.com> writes:
On Thursday, 6 December 2012 at 22:26:07 UTC, Rainer Schuetze 
wrote:
 On 06.12.2012 23:14, Nekroze wrote:
 On Thursday, 6 December 2012 at 22:06:43 UTC, Rainer Schuetze 
 wrote:
 On 06.12.2012 23:00, Nekroze wrote:
 On Thursday, 6 December 2012 at 21:28:38 UTC, Rainer 
 Schuetze wrote:
 On 06.12.2012 22:03, Nekroze wrote:
 Ok so I have the need to make a static library that will 
 be reused in
 multiple future projects. My thinking was that in future 
 solutions
 i can
 just add an existing project, my static library project, 
 so it would
 grab it and just work. However i cannot seem to get it to 
 work.

 I have a solution with a console app and the static 
 library at the
 moment and have made the console app have the static 
 library as a
 dependency. under the project settings of the console app 
 i cannot
 seem
 to disable using the "standard import paths" but even if i 
 add the
 path
 to the standard import paths in the visual d settings it 
 still doesn't
 work.

 I could probably make this working by making my own sc.ini 
 but that is
 something i would rather not do if i don't have to and i 
 am sure there
 is a way of making this work.

 Any help would be greatly appreciated!

You should set the dependency in the "Project Dependencies" dialog.

As i said in the OP i have done this but it still doesn't work. I think in Visual D all that changes is the build order etc. not the importing and linking by the looks of it.

It puts the output of the library project on the command line of the dependent project. Please check the build log or post it here.

Thats what i have done, im not sure if its linking correctly because it cant even get past importing. On the note of linking it should just link it right i shouldnt have to put a pragma or specific command line arg extra in? https://dl.dropbox.com/u/27223793/demo.buildlog.html That is the link to the build log it just doesn't import.

Ah, I misunderstood, it's not a linking problem, but an import issue. You have to specify the path to the library sources (probably D:\Dropbox\Projects\edquizlib in your case) in the "Additional imports" setting of the project. There's been an enhancement request before to add this import path automatically to dependent projects, but it isn't always obvious from the file names only which path is the correct one.

Oh that works now. You where right putting it in additional imports can work even though its all greyed out. https://dl.dropbox.com/u/27223793/properties.bmp You can see that the ability to deselect and the text boxes are 'disabled' or greyed out so i didn't think they would function. Thanks for the help. would be nice to have this added with dependencies automatically.
Dec 06 2012