Re: pragma lib doesn't support static libraries?

2023-07-29 Thread ryuukk_ via Digitalmars-d-learn
On Sunday, 30 July 2023 at 05:53:55 UTC, Mike Parker wrote: On Sunday, 30 July 2023 at 05:28:32 UTC, ryuukk_ wrote: I should have explained exactly what i am doing.. Looks like it doesn't work when i compile in 2 step - compile with: ``dmd -c of=bin/game.o`` - link with: ``dmd bin/game.o`` Wh

Re: pragma lib doesn't support static libraries?

2023-07-29 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 30 July 2023 at 05:28:32 UTC, ryuukk_ wrote: I should have explained exactly what i am doing.. Looks like it doesn't work when i compile in 2 step - compile with: ``dmd -c of=bin/game.o`` - link with: ``dmd bin/game.o`` When doing it this way, then it doesn't work However, when com

Re: pragma lib doesn't support static libraries?

2023-07-29 Thread ryuukk_ via Digitalmars-d-learn
I should have explained exactly what i am doing.. Looks like it doesn't work when i compile in 2 step - compile with: ``dmd -c of=bin/game.o`` - link with: ``dmd bin/game.o`` When doing it this way, then it doesn't work However, when compiling/linking in one ``dmd`` invocation (without ``-c``

pragma lib doesn't support static libraries?

2023-07-29 Thread ryuukk_ via Digitalmars-d-learn
Hello, I'm trying to simplify my build script, i have this library that i statically link OS: linux ``dmd app.d mongoose/bin/linux/mongoose.a`` becomes: ``` package mongoose; pragma(lib, "mongoose/bin/linux/mongoose.a"); ``` However, it no longer compile, and it complains about ``undefin

How do we display Unicode in Visual D console output?

2023-07-29 Thread Daniel via Digitalmars-d-learn
Right now, fresh install of VS and Visual D, all up-to-date. Can't display ∈, so how can we fix this? There is no project setting for Unicode chars. Thanks! EnjoysMath

Re: dub Fetches Wrong Package Version

2023-07-29 Thread Dennis via Digitalmars-d-learn
On Saturday, 29 July 2023 at 16:47:34 UTC, Ruby The Roobster wrote: Dub refuses to fetch the ~master branch of a package, even when dub.json tells it to. Is there any workaround to this? Delete dub.selections.json, which locks in dependency versions until you explicitly upgrade.

dub Fetches Wrong Package Version

2023-07-29 Thread Ruby The Roobster via Digitalmars-d-learn
Dub refuses to fetch the ~master branch of a package, even when dub.json tells it to. Is there any workaround to this?

Re: Make a function available under different names.

2023-07-29 Thread ryuukk_ via Digitalmars-d-learn
There are 2 ways you can solve your problem ```d string returnExecutableName(string[] arguments) { // if you compile with `-debug` it'll run this block debug { write("Debug mode is enabled.\n"); write(" Executable_Name: " ~ arguments[0] ~ "\n");

Re: Make a function available under different names.

2023-07-29 Thread 00004 via Digitalmars-d-learn
And here is my latest evolution of the code I've shared previously. ``` module utilities; import std.stdio : write; string returnExecutableName(string[] arguments, bool debugging=false) { if (debugging == true){ write("Debug mode is enabled.\n"); write

Re: Make a function available under different names.

2023-07-29 Thread 00004 via Digitalmars-d-learn
Here is some more updated code that works. ``` module utilities; import std.stdio : write; string returnExecutableNameFromMainFunction(string[] arguments, bool debugging=false) { if (debugging == true){ write("Debug mode is enabled.\n"); write(" Executa

Re: Make a function available under different names.

2023-07-29 Thread 00004 via Digitalmars-d-learn
On Saturday, 29 July 2023 at 14:26:17 UTC, 4 wrote: Let's say I have these two functions: They have duplicate functionality. ``` string getExecutableNameFromMainFunction(string[] arguments){ write("Executable_Name: " ~ arguments[0] ~ "\n"); write("Debug mode is enabled.\n");

Make a function available under different names.

2023-07-29 Thread 00004 via Digitalmars-d-learn
Let's say I have these two functions: They have duplicate functionality. ``` string getExecutableNameFromMainFunction(string[] arguments){ write("Executable_Name: " ~ arguments[0] ~ "\n"); write("Debug mode is enabled.\n"); return arguments[0]; } string printExecutableNameFro

Re: Getting __COLUMN__ of source code location.

2023-07-29 Thread realhet via Digitalmars-d-learn
On Thursday, 27 July 2023 at 16:17:28 UTC, IchorDev wrote: I'm not aware of any way to do that exact thing. Measuring what column a line is on would be quite subjective. When I compile(LDC2) a something with an error and using the --vcolumns argument I get this: onlineapp.d(14,5): Error: found