Re: Dub version

2019-08-08 Thread Andre Pany via Digitalmars-d-learn
On Friday, 9 August 2019 at 01:36:43 UTC, greatsam4sure wrote: On Friday, 9 August 2019 at 01:18:12 UTC, Elronnd wrote: Dub add is not supported in dub 1.11.0 Use 'dub fetch'. dub fetch dub Fetching dub 1.16.0... Please note that you need to use `dub run ` or add it to dependencies of

Re: Dub version

2019-08-08 Thread greatsam4sure via Digitalmars-d-learn
On Friday, 9 August 2019 at 01:18:12 UTC, Elronnd wrote: Dub add is not supported in dub 1.11.0 Use 'dub fetch'. dub fetch dub Fetching dub 1.16.0... Please note that you need to use `dub run ` or add it to dependencies of your package to actually use/run it. dub does not do actual

Re: Dub version

2019-08-08 Thread Elronnd via Digitalmars-d-learn
Dub add is not supported in dub 1.11.0 Use 'dub fetch'.

Dub version

2019-08-08 Thread GreatSam4sure via Digitalmars-d-learn
Which version of dub support dub add library name? Dub add is not supported in dub 1.11.0 Besides I could not run rdmd on my windows 10 core i7. It days this app cannot run on this machine What is the way out? Where can I get window binary for dub that is higher than dub 1.11.0

Re: Module static constructor doesn't work?

2019-08-08 Thread Andrey Zherikov via Digitalmars-d-learn
On Thursday, 8 August 2019 at 16:04:33 UTC, a11e99z wrote: On Thursday, 8 August 2019 at 14:55:37 UTC, Andrey Zherikov wrote: I have the following code: // main.d int main() { import std.stdio; writeln("hello"); return 0; } But if I create library from lib.d first and then link it

Re: LNK4255 warning - should I be concerned?

2019-08-08 Thread DanielG via Digitalmars-d-learn
(Maybe I should add: this is on DMD 2.086.0, Windows 10)

LNK4255 warning - should I be concerned?

2019-08-08 Thread DanielG via Digitalmars-d-learn
"warning LNK4255: library contain multiple objects of the same name; linking object as if no debug info" Is there some way to get more detail about this warning? Might help to know which objects ... My program is working fine now, but is this going to cause problems later on? Like when I

Re: Module static constructor doesn't work?

2019-08-08 Thread kinke via Digitalmars-d-learn
On Thursday, 8 August 2019 at 14:55:37 UTC, Andrey Zherikov wrote: But if I create library from lib.d first and then link it with main.d then ctor/dtor are not called: For this to work as expected, the `lib.obj` object file needs to be linked into the final executable. As main.d doesn't need

Re: Private variables accessible from outside class

2019-08-08 Thread ag0aep6g via Digitalmars-d-learn
On 08.08.19 18:03, Drobet wrote: Then why does it in the tour say that it can only be "seen by Integer"? https://tour.dlang.org/tour/en/basics/classes That's an error in the tour.

Re: Private variables accessible from outside class

2019-08-08 Thread Drobet via Digitalmars-d-learn
On Thursday, 8 August 2019 at 15:53:13 UTC, Zoadian wrote: private means module private in D. see: https://dlang.org/spec/attribute.html#visibility_attributes Then why does it in the tour say that it can only be "seen by Integer"? https://tour.dlang.org/tour/en/basics/classes

Re: Module static constructor doesn't work?

2019-08-08 Thread a11e99z via Digitalmars-d-learn
On Thursday, 8 August 2019 at 14:55:37 UTC, Andrey Zherikov wrote: I have the following code: // main.d int main() { import std.stdio; writeln("hello"); return 0; } But if I create library from lib.d first and then link it with main.d then ctor/dtor are not called: $ dmd.exe -lib

Re: Private variables accessible from outside class

2019-08-08 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 8 August 2019 at 15:51:45 UTC, Drobet wrote: I'm having a weird issue, where after defining my classes variables as private, they can still be modified and looked at from the outside. That leads to this code compiling with no issues. [...] My question is if this is intended

Re: Private variables accessible from outside class

2019-08-08 Thread Ethan via Digitalmars-d-learn
On Thursday, 8 August 2019 at 15:51:45 UTC, Drobet wrote: I'm having a weird issue, where after defining my classes variables as private https://dlang.org/spec/attribute.html Section 8.4.2 of the spec reads: Symbols with private visibility can only be accessed from within the same module.

Re: Private variables accessible from outside class

2019-08-08 Thread matheus via Digitalmars-d-learn
On Thursday, 8 August 2019 at 15:51:45 UTC, Drobet wrote: ... My question is if this is intended behavior, and if yes, why? This is true if the class is inside the same module: "Private means that only members of the enclosing class can access the member, or members and functions in the same

Private variables accessible from outside class

2019-08-08 Thread Drobet via Digitalmars-d-learn
I'm having a weird issue, where after defining my classes variables as private, they can still be modified and looked at from the outside. That leads to this code compiling with no issues. import std.stdio; class Vector3 { this(double _x = 0.0, double _y = 0.0, double _z = 0.0) {

Re: Private variables accessible from outside class

2019-08-08 Thread Zoadian via Digitalmars-d-learn
On Thursday, 8 August 2019 at 15:51:45 UTC, Drobet wrote: I'm having a weird issue, where after defining my classes variables as private, they can still be modified and looked at from the outside. That leads to this code compiling with no issues. import std.stdio; class Vector3 {

Re: Module static constructor doesn't work?

2019-08-08 Thread Dukc via Digitalmars-d-learn
On Thursday, 8 August 2019 at 14:55:37 UTC, Andrey Zherikov wrote: I have the following code: // lib1/lib.d module lib; import std.stdio; static this() { writeln("+" ~ __FILE__); } static ~this() { writeln("-" ~ __FILE__); } // main.d int main() { import std.stdio;

Module static constructor doesn't work?

2019-08-08 Thread Andrey Zherikov via Digitalmars-d-learn
I have the following code: // lib1/lib.d module lib; import std.stdio; static this() { writeln("+" ~ __FILE__); } static ~this() { writeln("-" ~ __FILE__); } // main.d int main() { import std.stdio; writeln("hello"); return 0; } So if I compile lib.d and main.d together