Re: Error: cannot use non-constant CTFE pointer in an initializer `cast(immutable(char)*)TEST`

2022-06-11 Thread Tejas via Digitalmars-d-learn
On Saturday, 11 June 2022 at 10:07:46 UTC, test123 wrote: how to work this around. ```d __gshared const TEST = import(`onlineapp.d`); extern(C) void main(){ __gshared bin_ptr = TEST.ptr; } ``` ```sh dmd2 -betterC -J. onlineapp.d onlineapp.d(3): Error: cannot use non-constant CTFE

Error: cannot use non-constant CTFE pointer in an initializer `cast(immutable(char)*)TEST`

2022-06-11 Thread test123 via Digitalmars-d-learn
how to work this around. ```d __gshared const TEST = import(`onlineapp.d`); extern(C) void main(){ __gshared bin_ptr = TEST.ptr; } ``` ```sh dmd2 -betterC -J. onlineapp.d onlineapp.d(3): Error: cannot use non-constant CTFE pointer in an initializer `cast(immutable(char)*)TEST` ```

Re: freebsd dub linker error

2022-06-01 Thread Kagamin via Digitalmars-d-learn
Try to run clang with -v option and compare with gcc.

Re: freebsd dub linker error

2022-06-01 Thread Alain De Vos via Digitalmars-d-learn
The detailed error is : ``` /usr/bin/clang test.o -o test -L/usr/local/lib -lphobos2-ldc -ldruntime-ldc -Wl,--gc-sections -lexecinfo -lpthread -lm -m64 ld: error: undefined hidden symbol: __start___minfo referenced by test.d test.o:(ldc.register_dso) ```

Re: freebsd dub linker error

2022-06-01 Thread Alain De Vos via Digitalmars-d-learn
Performed additional tests. Compiling helloworld.d ``` export CC=gcc11 ; ldc2 helloworld.d ``` works fine. Compiling helloworld.d ``` export CC=clang ; ldc2 helloworld.d ``` returns: ``` d: error: undefined hidden symbol: __start___minfo referenced by test.d test.o

Re: Compiler switch for integer comparison/promotion to catch a simple error

2022-05-30 Thread Dom Disc via Digitalmars-d-learn
On Sunday, 29 May 2022 at 01:35:23 UTC, frame wrote: Is there a compiler switch to catch this kind of error? ```d ulong v = 1; writeln(v > -1); ``` IMHO the compiler should bail a warning if it sees a logic comparison between signed and unsigned / different integer sizes. There is 50% cha

Re: Compiler switch for integer comparison/promotion to catch a simple error

2022-05-30 Thread matheus via Digitalmars-d-learn
On Monday, 30 May 2022 at 13:15:12 UTC, bauss wrote: Good luck convincing Walter that this is a mistake :) I don't think this is a matter of convincing or changing the behavior, I think that a flag for this case (If not exist) should be added as a warning. A language where some people use t

Re: Compiler switch for integer comparison/promotion to catch a simple error

2022-05-30 Thread frame via Digitalmars-d-learn
On Monday, 30 May 2022 at 13:15:12 UTC, bauss wrote: Good luck convincing Walter that this is a mistake :) Well, I'm not talking about this is a mistake, just a C-thing I think. I wouldn't even ask him about that since it's in the spec. If I could I would just clone a DMD build, disable out

Re: Compiler switch for integer comparison/promotion to catch a simple error

2022-05-30 Thread bauss via Digitalmars-d-learn
On Sunday, 29 May 2022 at 01:35:23 UTC, frame wrote: Is there a compiler switch to catch this kind of error? ```d ulong v = 1; writeln(v > -1); ``` IMHO the compiler should bail a warning if it sees a logic comparison between signed and unsigned / different integer sizes. There is 50% cha

Re: Compiler switch for integer comparison/promotion to catch a simple error

2022-05-29 Thread matheus via Digitalmars-d-learn
On Sunday, 29 May 2022 at 01:35:23 UTC, frame wrote: Is there a compiler switch to catch this kind of error? ```d ulong v = 1; writeln(v > -1); ``` IMHO the compiler should bail a warning if it sees a logic comparison between signed and unsigned / different integer sizes. There is 50% cha

Compiler switch for integer comparison/promotion to catch a simple error

2022-05-28 Thread frame via Digitalmars-d-learn
Is there a compiler switch to catch this kind of error? ```d ulong v = 1; writeln(v > -1); ``` IMHO the compiler should bail a warning if it sees a logic comparison between signed and unsigned / different integer sizes. There is 50% chance that a implicit conversion was not intended.

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-26 Thread frame via Digitalmars-d-learn
doesn't work. It compiles, but the program does not run afterwards. I also tried to add -m32omf But in this case the compilation error. How to solve this? There is no support for OMF for x64, 64bit build is always MS-COFF. If you specify -m64 you will generate x64 MS-COFF files. If you sp

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-26 Thread Marcone via Digitalmars-d-learn
On Friday, 20 May 2022 at 13:16:00 UTC, frame wrote: On Thursday, 19 May 2022 at 20:20:49 UTC, Marcone wrote: I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD. Did you try 2.099 too? Because the default

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-20 Thread Marcone via Digitalmars-d-learn
On Friday, 20 May 2022 at 13:16:00 UTC, frame wrote: On Thursday, 19 May 2022 at 20:20:49 UTC, Marcone wrote: I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD. Did you try 2.099 too? Because the default

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-20 Thread frame via Digitalmars-d-learn
On Thursday, 19 May 2022 at 20:20:49 UTC, Marcone wrote: I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD. Did you try 2.099 too? Because the default build mode for 32bit was changed to MS-COFF and it

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Marcone via Digitalmars-d-learn
On Thursday, 19 May 2022 at 22:13:06 UTC, Adam Ruppe wrote: On Thursday, 19 May 2022 at 21:41:50 UTC, Marcone wrote: Are you using the `-L/entry:mainCRTStartup` or the `L/entry:wmainCRTStartup` ? -L/entry:mainCRTStartup try the w one too. both doing the same result? Both is doing the same

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Adam Ruppe via Digitalmars-d-learn
On Thursday, 19 May 2022 at 21:41:50 UTC, Marcone wrote: Are you using the `-L/entry:mainCRTStartup` or the `L/entry:wmainCRTStartup` ? -L/entry:mainCRTStartup try the w one too. both doing the same result?

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Marcone via Digitalmars-d-learn
On Thursday, 19 May 2022 at 20:33:34 UTC, Adam D Ruppe wrote: On Thursday, 19 May 2022 at 20:20:49 UTC, Marcone wrote: I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD. Are you using the `-L

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 19 May 2022 at 20:20:49 UTC, Marcone wrote: I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD. Are you using the `-L/entry:mainCRTStartup` or the `L/entry:wmainCRTStartup` ?

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Marcone via Digitalmars-d-learn
splay.html#installation-instructions I am using a main() function. I am compiling on Windows x86 32 bits. I am using DMD 2.100.0 This error is only in version 2.100.0 of DMD.

Re: Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 19 May 2022 at 19:29:25 UTC, Marcone wrote: Using -L/SUBSYSTEM:windows user32.lib you using a main() function right? Please note when compiling on Win64, you need to explicitly list -Lgdi32.lib -Luser32.lib on the build command. If you want the Windows subsystem too, use -L/subs

Error: undefined symbol: _WinMain@16 When try compile no console

2022-05-19 Thread Marcone via Digitalmars-d-learn
Using -L/SUBSYSTEM:windows user32.lib Error: lld-link: error: undefined symbol: _WinMain@16 referenced by msvcrt120.lib(msvcrt_stub2.obj):(_WinMainCRTStartup) Error: linker exited with status 1

Re: vibe.d ubuntu 22.04 ssl linking error

2022-05-18 Thread Gavin Gray via Digitalmars-d-learn
On Wednesday, 18 May 2022 at 20:41:53 UTC, Gavin Gray wrote: After upgrading to ubuntu 22.04, I get the linker error below for a project that previously built successfully. OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022) LDC - the LLVM D compiler (1.27.1): based on DMD

vibe.d ubuntu 22.04 ssl linking error

2022-05-18 Thread Gavin Gray via Digitalmars-d-learn
After upgrading to ubuntu 22.04, I get the linker error below for a project that previously built successfully. OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022) LDC - the LLVM D compiler (1.27.1): based on DMD v2.097.2 and LLVM 12.0.1 built with LDC - the LLVM D compiler

Re: freebsd dub linker error

2022-05-16 Thread Alain De Vos via Digitalmars-d-learn
Bugs in the clang/llvm toolchain but not in the gcc toolchain ?

Re: freebsd dub linker error

2022-05-16 Thread Alain De Vos via Digitalmars-d-learn
The following worked , and i don't know what is going on: ``` ldc2 --gcc=gcc11 ```

Re: freebsd dub linker error

2022-05-16 Thread Alain De Vos via Digitalmars-d-learn
The problem re-appeared and i have totally no idea what caused it. ldc2 test.d ld: error: undefined hidden symbol: __start___minfo referenced by test.d test.o:(ldc.register_dso) ld: error: undefined hidden symbol: __stop___minfo referenced by test.d test.o

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread zoujiaqing via Digitalmars-d-learn
On Friday, 13 May 2022 at 19:48:04 UTC, Steven Schveighoffer wrote: On 5/13/22 3:46 PM, Steven Schveighoffer wrote: What writeln? Your compile trace is missing the original call line, and I would say probably more. Looking at your last commit, I figured it out: https://github.com/kerisy/arc

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/13/22 3:46 PM, Steven Schveighoffer wrote: What writeln? Your compile trace is missing the original call line, and I would say probably more. Looking at your last commit, I figured it out: https://github.com/kerisy/archttp/blob/545b3eb738261e92c88b4e4bb664b4fdfb206398/source/archttp/cod

Re: Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread Steven Schveighoffer via Digitalmars-d-learn
s/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25): Deprecation: `catch` statement without an exception specification is deprecated ../../.dub/packages/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25): use `catch(Throwable)` for old behavior SSE: false /opt/dmd/osx/bin/../../src/phobos/std/st

Error: variable `impl` cannot be modified at compile time

2022-05-13 Thread zoujiaqing via Digitalmars-d-learn
nbuff/buffer.d(74,25): Deprecation: `catch` statement without an exception specification is deprecated ../../.dub/packages/nbuff-0.1.14/nbuff/source/nbuff/buffer.d(74,25):use `catch(Throwable)` for old behavior SSE: false /opt/dmd/osx/bin/../../src/phobos/std/stdio.d(5190,5): Error: variable `impl` c

Re: error connecting to mongodb atlas with vibe.d

2022-05-01 Thread Arjan via Digitalmars-d-learn
ed by vibe.d ``` string MongoURL = "mongodb://username:@cluster0-shard-00-01.gaetq.mongodb.net:27017"; auto client = connectMongoDB(MongoURL); ``` but am getting error [1] below. Alternatively if I use the following path to the instance ``` string MongoURL =

Re: error connecting to mongodb atlas with vibe.d

2022-04-30 Thread Tejas via Digitalmars-d-learn
On Saturday, 30 April 2022 at 14:29:56 UTC, notsteve wrote: Hi, I am trying to setup a simple webserver in D using vibe.d (0.9.4) and want to use mongoDB as a database. To achieve this, I've set up a mongoDB atlas instance with the following command inside the standard app.d file created by v

error connecting to mongodb atlas with vibe.d

2022-04-30 Thread notsteve via Digitalmars-d-learn
//username:@cluster0-shard-00-01.gaetq.mongodb.net:27017"; auto client = connectMongoDB(MongoURL); ``` but am getting error [1] below. Alternatively if I use the following path to the instance ``` string MongoURL = "mongodb://username:passw...@cluster0-shard-00-01.gae

Re: QtE56: QFormBuilder: Error: undefined identifier `QFormBuilder`

2022-04-28 Thread Marcone via Digitalmars-d-learn
On Thursday, 28 April 2022 at 07:02:14 UTC, MGW wrote: Probably did not compile QtE5-master/build/QtE56/qte56core.pro QtE5-master/build/QtE56/qte56widgets.pro Use QMAKE to build a DLL/SO More details by mail: m...@yandex.ru I sent you an email. Could you answer me and send me these dlls for W

Re: QtE56: QFormBuilder: Error: undefined identifier `QFormBuilder`

2022-04-28 Thread Marcone via Digitalmars-d-learn
On Thursday, 28 April 2022 at 07:02:14 UTC, MGW wrote: Probably did not compile QtE5-master/build/QtE56/qte56core.pro QtE5-master/build/QtE56/qte56widgets.pro Use QMAKE to build a DLL/SO More details by mail: m...@yandex.ru Hi, I didn't compile it as Qt is too big for me to download just to u

Re: QtE56: QFormBuilder: Error: undefined identifier `QFormBuilder`

2022-04-28 Thread MGW via Digitalmars-d-learn
Probably did not compile QtE5-master/build/QtE56/qte56core.pro QtE5-master/build/QtE56/qte56widgets.pro Use QMAKE to build a DLL/SO More details by mail: m...@yandex.ru

QtE56: QFormBuilder: Error: undefined identifier `QFormBuilder`

2022-04-26 Thread Marcone via Digitalmars-d-learn
I'm trying to load a .ui GUI designed in Qt Designer. I'm following the examples in the links below, but the following error occurs: Error: undefined identifier `QFormBuilder` QFormBuilder qfb = new QFormBuilder(this); setQtObj((qfb.load(":/fQtE56help.ui")).QtObj); * htt

Re: ldc2 error , Error: declaration . . is already defined

2022-04-20 Thread Alain De Vos via Digitalmars-d-learn
On Wednesday, 20 April 2022 at 18:04:13 UTC, Alain De Vos wrote: When compiling a .d file i don't see line numbers on which the error occurs which is quite annoying. The line i use to compile is : ldc2 --gcc=cc --vcolumns --oq --dip1000 --dip25 --safe-stack-layout --boundscheck=on --D --

ldc2 error , Error: declaration . . is already defined

2022-04-20 Thread Alain De Vos via Digitalmars-d-learn
When compiling a .d file i don't see line numbers on which the error occurs which is quite annoying. The line i use to compile is : ldc2 --gcc=cc --vcolumns --oq --dip1000 --dip25 --safe-stack-layout --boundscheck=on --D --g --w --de --d-debug `find . -name \*.d -print` Even: lcd2 t

Re: freebsd dub linker error

2022-03-17 Thread rikki cattermole via Digitalmars-d-learn
On 18/03/2022 5:56 PM, rikki cattermole wrote: Are you trying to build dub on Android? Android support for ldc is currently broken to due to removal of a linker that is currently required for TLS support. https://github.com/ldc-developers/ldc/issues/3918 My bad I didn't see FreeBSD. Simi

Re: freebsd dub linker error

2022-03-17 Thread rikki cattermole via Digitalmars-d-learn
Are you trying to build dub on Android? Android support for ldc is currently broken to due to removal of a linker that is currently required for TLS support. https://github.com/ldc-developers/ldc/issues/3918

freebsd dub linker error

2022-03-17 Thread Alain De Vos via Digitalmars-d-learn
I disabled 32bit code maybe this created the following error while building dub : [00:02:18] === [00:02:18] ===> [00:02:18] ===> Configuring for dub-1.14.0 [00

Re: error forward references if scope

2022-03-12 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 12 March 2022 at 13:12:25 UTC, vit wrote: ```d enum touch_T = __traits(hasMember, T, "touch"); ``` I think you meant build instead of touch? ```d struct Query { public const SharedPtr!Builder builder; } interface Builder { void build(ref Query query); } struct SharedPtr(T) {

error forward references if scope

2022-03-12 Thread vit via Digitalmars-d-learn
`ref Query query` is scope then there is error? ```d struct Query{ public const SharedPtr!Builder builder; } interface Builder{ void build(scope ref Query query); //SCOPE } struct SharedPtr(T){ enum touch_T = __traits(hasMember, T, "touch"); //... } void main(){

Re: curl error msg

2022-02-20 Thread Anonymouse via Digitalmars-d-learn
On Saturday, 19 February 2022 at 13:12:32 UTC, MichaelBi wrote: when running the example in the std.net.curl on my windows, got following msg: std.net.curl.CurlException@std\net\curl.d(4239): Failed to load curl, tried "libcurl.dll", "curl.dll" does it mean i don't have those dll files? thx.

Re: curl error msg

2022-02-20 Thread frame via Digitalmars-d-learn
On Saturday, 19 February 2022 at 13:12:32 UTC, MichaelBi wrote: when running the example in the std.net.curl on my windows, got following msg: std.net.curl.CurlException@std\net\curl.d(4239): Failed to load curl, tried "libcurl.dll", "curl.dll" does it mean i don't have those dll files? thx.

curl error msg

2022-02-19 Thread MichaelBi via Digitalmars-d-learn
when running the example in the std.net.curl on my windows, got following msg: std.net.curl.CurlException@std\net\curl.d(4239): Failed to load curl, tried "libcurl.dll", "curl.dll" does it mean i don't have those dll files? thx.

Re: split Error - no overload matches

2022-02-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Feb 15, 2022 at 06:37:44PM +, meta via Digitalmars-d-learn wrote: > A trick i use often: > > ```D > import std; > > void main() > { > import uni = std.uni; > writeln("Learning D is fun".split!(uni.isWhite)); > } > > ``` > > Under-rated way of importing things, you don't blo

Re: split Error - no overload matches

2022-02-15 Thread meta via Digitalmars-d-learn
A trick i use often: ```D import std; void main() { import uni = std.uni; writeln("Learning D is fun".split!(uni.isWhite)); } ``` Under-rated way of importing things, you don't bloat your scope anymore

Re: split Error - no overload matches

2022-02-15 Thread Steven Schveighoffer via Digitalmars-d-learn
"isWhite" is ambiguous. There's std.uni.isWhite and std.ascii.isWhite. `import std;` can't know which one you want. thanks. a little more help from the compiler itself would also have been appreciated ;-) e.g: Error: The call to isWhite is ambiguous between the follow

Re: split Error - no overload matches

2022-02-14 Thread forkit via Digitalmars-d-learn
. There's std.uni.isWhite and std.ascii.isWhite. `import std;` can't know which one you want. thanks. a little more help from the compiler itself would also have been appreciated ;-) e.g: Error: The call to isWhite is ambiguous between the following methods: 'std.uni.isWhite' and 'std.ascii.isWhite'

Re: split Error - no overload matches

2022-02-14 Thread ag0aep6g via Digitalmars-d-learn
On 14.02.22 12:14, forkit wrote: However, if I uncomment the //import std.uni : isWhite; then it will compile. I don't understand. I thought 'import std;' would be sufficient here?? "isWhite" is ambiguous. There's std.uni.isWhite and std.ascii.isWhite. `import std;` can't know which one you

split Error - no overload matches

2022-02-14 Thread forkit via Digitalmars-d-learn
This code will not compile. Error: no overload matches for `split` However, if I uncomment the //import std.uni : isWhite; then it will compile. I don't understand. I thought 'import std;' would be sufficient here?? // module test; @safe: import std; void main()

Re: Linker error under Ubuntu

2022-01-17 Thread murphybeck via Digitalmars-d-learn
error please note before the error it may say you are missing a package or header file — you should find those and install them and verify if it works For Python 2.x use: $ sudo apt-get install python-dev If you using [python](http://net-informations.com/python/iq/default.htm)3, try to replace

Re: error: rvalue constructor and a copy constructor

2022-01-12 Thread vit via Digitalmars-d-learn
On Wednesday, 12 January 2022 at 08:04:19 UTC, vit wrote: Hello, I have this code: ```d [...] run.dlang.io has old version of dmd-beta/dmd-nightly with bug

error: rvalue constructor and a copy constructor

2022-01-12 Thread vit via Digitalmars-d-learn
("end"); } ``` When is this code compiled with 2.098.1 then it print: ``` Error: Cannot define both an rvalue constructor and a copy constructor for `struct Foo` Template instance `__ctor!(Foo)` creates a rvalue constructor for `struct Foo` Error: template instance `onl

Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread frame via Digitalmars-d-learn
On Monday, 3 January 2022 at 09:20:57 UTC, Simon wrote: oops this went into the wrong forum! Sorry! I will repost this as a compiler issue, any moderator feel free to delete this post. I got a similar issue once if a process (symbol server registry or something) locked the PDB files and t

Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread russhy via Digitalmars-d-learn
On Monday, 3 January 2022 at 09:20:57 UTC, Simon wrote: oops this went into the wrong forum! Sorry! I will repost this as a compiler issue, any moderator feel free to delete this post. Are you using dub? if the problem appeared over night, then it sounds like a cache issue, probably due t

Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
oops this went into the wrong forum! Sorry! I will repost this as a compiler issue, any moderator feel free to delete this post.

Re: compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
Forgot to mention: I'm using DMD, and the Windows 10 is 64 bit.

compiler fails with fatal error LNK1318: Unexpected PDB-error: OK (0) ""

2022-01-03 Thread Simon via Digitalmars-d-learn
When compiling my project using v2.098.0 or v2.098.1 on Windows 10, this error just appeared: : fatal error LNK1318: Unerwarteter PDB-Fehler: OK (0) "". Error: linker exited with status 1318 "Unerwarteter PDB-Fehler" means "Unexpected PDB-error". The next 3 a

Re: opCast + dtor error

2021-12-29 Thread vit via Digitalmars-d-learn
On Wednesday, 29 December 2021 at 01:00:53 UTC, Tejas wrote: On Tuesday, 28 December 2021 at 18:27:36 UTC, vit wrote: [...] Since a destructor ignores `const`, I think adding the `~this` to Foo manually is somehow making the compiler have to actually cast away const, which it is doing via `c

Re: opCast + dtor error

2021-12-28 Thread Tejas via Digitalmars-d-learn
On Tuesday, 28 December 2021 at 18:27:36 UTC, vit wrote: Hi, why this code doesn't compile? ```d struct Foo{ bool opCast(T : bool)()const{ assert(0); } ~this(){} } struct Bar{ const Foo foo; } void main(){ } ``` Error: template instance `opCast!(Foo)` doe

opCast + dtor error

2021-12-28 Thread vit via Digitalmars-d-learn
Hi, why this code doesn't compile? ```d struct Foo{ bool opCast(T : bool)()const{ assert(0); } ~this(){} } struct Bar{ const Foo foo; } void main(){ } ``` Error: template instance `opCast!(Foo)` does not match template declaration `opCast(T : bool)()`

Re: Error: template instance does not match template declaration

2021-11-17 Thread Vitalii via Digitalmars-d-learn
On Wednesday, 17 November 2021 at 18:00:59 UTC, Steven Schveighoffer wrote: On 11/17/21 7:55 AM, Vitalii wrote: [...] Template parameters are of 3 types: 1. A type parameter. This has a single symbol name, and represents a type *provided by the caller*. [...] Steve, thank you very much f

Re: Error: template instance does not match template declaration

2021-11-17 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/17/21 7:55 AM, Vitalii wrote: Thank you for response, Tejas! What I intended to do was make a class with only two states ("Inspect" - do some analysis, "Execute" - do some stuff). That's why I tried to use template specialization. Template parameters are of 3 types: 1. A type paramete

Re: Error: template instance does not match template declaration

2021-11-17 Thread Tejas via Digitalmars-d-learn
On Wednesday, 17 November 2021 at 12:55:15 UTC, Vitalii wrote: Thank you for response, Tejas! What I intended to do was make a class with only two states ("Inspect" - do some analysis, "Execute" - do some stuff). That's why I tried to use template specialization. The following code compiles

Re: Error: template instance does not match template declaration

2021-11-17 Thread Vitalii via Digitalmars-d-learn
Thank you for response, Tejas! What I intended to do was make a class with only two states ("Inspect" - do some analysis, "Execute" - do some stuff). That's why I tried to use template specialization. The following code compiles successfully, but return *"fun with unknown"* instead of *"fun

Re: Error: template instance does not match template declaration

2021-11-17 Thread Tejas via Digitalmars-d-learn
On Wednesday, 17 November 2021 at 12:19:05 UTC, Tejas wrote: On Wednesday, 17 November 2021 at 10:10:43 UTC, Vitalii wrote: Hello! I am getting the following error: ``` inst.d(8): Error: template instance `Worker!(Mode.Inspect)` does not match template declaration `Worker(mode : Mode

Re: Error: template instance does not match template declaration

2021-11-17 Thread Tejas via Digitalmars-d-learn
On Wednesday, 17 November 2021 at 10:10:43 UTC, Vitalii wrote: Hello! I am getting the following error: ``` inst.d(8): Error: template instance `Worker!(Mode.Inspect)` does not match template declaration `Worker(mode : Mode) ``` when compile next code: ``` enum Mode { Inspect, Execute

Error: template instance does not match template declaration

2021-11-17 Thread Vitalii via Digitalmars-d-learn
Hello! I am getting the following error: ``` inst.d(8): Error: template instance `Worker!(Mode.Inspect)` does not match template declaration `Worker(mode : Mode) ``` when compile next code: ``` enum Mode { Inspect, Execute } class Worker(mode : Mode) { this() {} } void main

Re: "need `this` for `s` of type `char*`" error message

2021-11-10 Thread rempas via Digitalmars-d-learn
On Thursday, 11 November 2021 at 07:15:04 UTC, Mathias LANG wrote: [...] Note that instead of doing this work yourself, I would highly recommend the excellent [dstep](https://github.com/jacob-carlborg/dstep). Fixed formatting (so much for "Fix it for me"). Oh, now it makes sense! Thanks a

Re: "need `this` for `s` of type `char*`" error message

2021-11-10 Thread Mathias LANG via Digitalmars-d-learn
On Thursday, 11 November 2021 at 07:10:39 UTC, Mathias LANG wrote: [...] Your type definition is wrong: ```D struct toml_datum_t { int ok; union u { toml_timestamp_t* ts; /* ts must be freed after use */ char* s; /* string value. s must be freed after use */ int b; /* bool

Re: "need `this` for `s` of type `char*`" error message

2021-11-10 Thread Mathias LANG via Digitalmars-d-learn
ond one contains the code from the example in the [usage](https://github.com/cktan/tomlc99#usage) section. However, when I try to compile, I'm getting the following error message: ``` main.d(51): Error: need `this` for `s` of type `char*` Deprecation: argument `__error` for format sp

"need `this` for `s` of type `char*`" error message

2021-11-10 Thread rempas via Digitalmars-d-learn
ps://github.com/cktan/tomlc99#usage) section. However, when I try to compile, I'm getting the following error message: ``` main.d(51): Error: need `this` for `s` of type `char*` Deprecation: argument `__error` for format specification `"%s"` must be `char*`, not `_error_` ma

Re: Strange multithreading error

2021-10-29 Thread Ruby The Roobster via Digitalmars-d-learn
On Friday, 29 October 2021 at 23:32:38 UTC, Steven Schveighoffer wrote: On Friday, 29 October 2021 at 22:02:53 UTC, Ruby The Roobster wrote: I am currently writing a test program for a collision function, that involves multithreading so I can simultaneously check for collisions and move a skele

Re: Strange multithreading error

2021-10-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On Friday, 29 October 2021 at 22:02:53 UTC, Ruby The Roobster wrote: I am currently writing a test program for a collision function, that involves multithreading so I can simultaneously check for collisions and move a skeleton at the same time. Because of this, I had to use ```shared``` object

Strange multithreading error

2021-10-29 Thread Ruby The Roobster via Digitalmars-d-learn
"skeleton.d." In a function I wrote for moving the skeletons, it uses operator overloading, which produces the following output: ```d physics.d(85): Error: none of the `opOpAssign` overloads of `Point` are callable for `j` of type `shared(Point)` physics.d(87): Error: none of the `

Re: Bitfileds Error: no identifier for declarator

2021-10-27 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 28 October 2021 at 05:51:27 UTC, Imperatorn wrote: Try renaming debug to something else Many thanks guys. I should have spotted that one!

Re: Bitfileds Error: no identifier for declarator

2021-10-27 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 28 October 2021 at 05:20:35 UTC, data pulverizer wrote: Hi, I am trying to compile the following items: [...] Try renaming debug to something else

Re: Bitfileds Error: no identifier for declarator

2021-10-27 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 28 October 2021 at 05:51:27 UTC, Imperatorn wrote: On Thursday, 28 October 2021 at 05:20:35 UTC, data pulverizer wrote: Hi, I am trying to compile the following items: [...] Try renaming debug to something else uint, "debugflag",1,

Re: Bitfileds Error: no identifier for declarator

2021-10-27 Thread Stanislav Blinov via Digitalmars-d-learn
On Thursday, 28 October 2021 at 05:20:35 UTC, data pulverizer wrote: I am trying to compile the following items: struct sxpinfo_struct { mixin(bitfields!( // ... uint, "debug",1, // ... } ``` But I get the error... `debug` is a language keyword, try a different

Re: Bitfileds Error: no identifier for declarator

2021-10-27 Thread data pulverizer via Digitalmars-d-learn
case someone is trying to replicate the error.

Bitfileds Error: no identifier for declarator

2021-10-27 Thread data pulverizer via Digitalmars-d-learn
, "alt", 1, uint, "gp", 16, uint, "mark", 1, uint, "debug",1, uint, "trace",1, uint, "spare",1, uint, "gcgen", 1, uint, "gccls", 3, uint, "named",

Re: Error: Could not open 'libcmt.lib'

2021-10-27 Thread bauss via Digitalmars-d-learn
On Monday, 25 October 2021 at 14:43:06 UTC, Willem wrote: Just starting out new with D. Up until now I have been using Python and a bit of OCaml. Error when linking: "lld-link: error: could not open 'libcmt.lib': no such file or directory" What I did: I installed the

Re: Error: Could not open 'libcmt.lib'

2021-10-26 Thread Willem via Digitalmars-d-learn
On Monday, 25 October 2021 at 20:00:06 UTC, Dr Machine Code wrote: On Monday, 25 October 2021 at 15:43:06 UTC, Willem wrote: I was able to resolve above issues by following the install guide by DrIggy @ https://www.youtube.com/watch?v=fuJBj_tgsR8 Thanks for posting it. Willem A friend of mi

Re: Error: Could not open 'libcmt.lib'

2021-10-25 Thread Dr Machine Code via Digitalmars-d-learn
On Monday, 25 October 2021 at 15:43:06 UTC, Willem wrote: I was able to resolve above issues by following the install guide by DrIggy @ https://www.youtube.com/watch?v=fuJBj_tgsR8 Thanks for posting it. Willem A friend of mine was with this issue. We just end up using ldc2 but would be nice

Re: Error: Could not open 'libcmt.lib'

2021-10-25 Thread Willem via Digitalmars-d-learn
I was able to resolve above issues by following the install guide by DrIggy @ https://www.youtube.com/watch?v=fuJBj_tgsR8 Thanks for posting it. Willem

Error: Could not open 'libcmt.lib'

2021-10-25 Thread Willem via Digitalmars-d-learn
Just starting out new with D. Up until now I have been using Python and a bit of OCaml. Error when linking: "lld-link: error: could not open 'libcmt.lib': no such file or directory" What I did: I installed the complete D setup in my Windows 10 PC -- including VS 2019

Re: Linker error

2021-10-12 Thread bauss via Digitalmars-d-learn
On Tuesday, 12 October 2021 at 00:01:25 UTC, jfondren wrote: On Monday, 11 October 2021 at 23:43:17 UTC, Ruby The Roobster wrote: package mixin template move__() { pragma(inline) package void mv(Point moveby, ref Skeleton tomove) { foreach(i;tomove.faces) {

Re: Linker error

2021-10-11 Thread jfondren via Digitalmars-d-learn
On Monday, 11 October 2021 at 23:43:17 UTC, Ruby The Roobster wrote: package mixin template move__() { pragma(inline) package void mv(Point moveby, ref Skeleton tomove) { foreach(i;tomove.faces) { foreach(k;i.lines) {

Linker error

2021-10-11 Thread Ruby The Roobster via Digitalmars-d-learn
public void decMove() { } ``` Now, here is a test file I am using to test the 'move()' function in physics.d: ```d import dutils.physics; void main() { Skeleton skele = Skeleton([Face([Line(new Point[0],Point(0,0,0),Point(0,0,0))],Point

Re: dub segfault and range error handling

2021-09-16 Thread jfondren via Digitalmars-d-learn
On Thursday, 16 September 2021 at 20:49:28 UTC, seany wrote: I compile with : `dub build -b release --compiler=ldc2` The result executing the compiled binary 'myproj' is is ( whether `writeln (a[1])` is uncommented, or the `test()` function is uncommented) some random number, usually negativ

Re: dub segfault and range error handling

2021-09-16 Thread seany via Digitalmars-d-learn
On Thursday, 16 September 2021 at 20:49:28 UTC, seany wrote: I create a new project with : `dub init myproj`. Then I change the source/app.d file with this : [...] PS :compiling with : `dub build -b release ` ( i.e. no ldc2) is a direct segfault of the code posted above. PPS : my system is

dub segfault and range error handling

2021-09-16 Thread seany via Digitalmars-d-learn
I create a new project with : `dub init myproj`. Then I change the source/app.d file with this : ` import std.stdio; import std.math; import std.stdio; import std.conv; import std.format; import std.math; import std.algorithm;

Re: object.d: Error: module object is in file 'object.d' which cannot be read

2021-09-13 Thread max haughton via Digitalmars-d-learn
On Tuesday, 14 September 2021 at 03:31:17 UTC, Kenneth Dallmann wrote: On Sunday, 27 March 2011 at 10:28:00 UTC, Ishan Thilina wrote: [...] I had the exact same problem, very frustrating. I believe I solved the issue, it was a simple error. When you are installing D, on Windows, it

Re: object.d: Error: module object is in file 'object.d' which cannot be read

2021-09-13 Thread Kenneth Dallmann via Digitalmars-d-learn
On Sunday, 27 March 2011 at 10:28:00 UTC, Ishan Thilina wrote: When I give "dmd untitled.d" command in my ubuntu maverick 64 bit laptop I get the following error. " object.d: Error: module object is in file 'object.d' which cannot be read import path[0] = /etc/../..

Re: Dustmite and linking error

2021-09-04 Thread JG via Digitalmars-d-learn
On Saturday, 4 September 2021 at 08:54:31 UTC, Mike Parker wrote: On Saturday, 4 September 2021 at 08:19:53 UTC, JG wrote: [...] You should be able to do that now with "sourceFiles" and "sourcePaths". Just avoid the default "source" or "src" directories and specify the paths and/or files yo

Re: Dustmite and linking error

2021-09-04 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 4 September 2021 at 08:19:53 UTC, JG wrote: As a small comment regarding dub. I can't help wondering if it really the best idea for each configuration to include everything by default and then have to exclude things? This means that when you add another configuration and source fi

<    1   2   3   4   5   6   7   8   9   10   >