Re: vibe-d linker error: undefined reference to deimos openssl

2024-09-16 Thread Curtis Spencer via Digitalmars-d-learn
x27;m at a loss for how to fix this linker error. Any help would be appreciated. You may have to specify the OpenSSL version with vibe-stream:tls https://vibed.org/docs#http-https -Steve Thanks. I added the following to my dub.sdl file: ``` dependency "vibe-stream:tls" version=&quo

Re: vibe-d linker error: undefined reference to deimos openssl

2024-09-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On Tuesday, 10 September 2024 at 20:41:12 UTC, Curtis Spencer wrote: I'm attempting to upgrade the vibe-d dependencies of a project. The project compiles fine using `dub`, but the linker fails with: … I'm at a loss for how to fix this linker error. Any help would be appreciated.

vibe-d linker error: undefined reference to deimos openssl

2024-09-10 Thread Curtis Spencer via Digitalmars-d-learn
E1DBD7D7C/libvibe-d_tls.a(openssl.o):(.data.rel.ro+0xa0): undefined reference to `_D6deimos7openssl6x509v312__ModuleInfoZ' collect2: error: ld returned 1 exit status Error: linker exited with status 1 ``` Here's version info: ``` $ dub --version DUB version 1.30.0, built on Jan 1 2023 $ dmd --v

Re: importC error: _Builtin_stddef

2024-08-30 Thread Tim via Digitalmars-d-learn
On Friday, 30 August 2024 at 04:49:48 UTC, Dakota wrote: get this error: ```sh In file included from /llvm/lib/clang/18/include/stddef.h:77, from /usr/include/time.h:29, from /llvm/include/clang-c/CXFile.h:17, from /llvm/include/clang-c

Re: importC error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h(168): Error: variable `lib_test.mach_vm_range_recipe_v1_

2024-08-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thursday, 8 August 2024 at 06:34:43 UTC, Dakota wrote: ```sh /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h(168): Error: variable `lib_test.mach_vm_range_recipe_v1_t.range` - no definition of struct `mach_vm_range

Re: importC error: _Builtin_stddef

2024-08-30 Thread Lance Bachmeier via Digitalmars-d-learn
On Friday, 30 August 2024 at 04:49:48 UTC, Dakota wrote: get this error: ```sh In file included from /llvm/lib/clang/18/include/stddef.h:77, from /usr/include/time.h:29, from /llvm/include/clang-c/CXFile.h:17, from /llvm/include/clang-c

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-25 Thread Serg Gini via Digitalmars-d-learn
On Saturday, 24 August 2024 at 00:24:12 UTC, Nicol Farran Terra wrote: wanted to use protobuf for data serialization between the two. Maybe consider to use msgpack instead of protobuf This version of protobuf is broken for modern versions of D compilers

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread IchorDev via Digitalmars-d-learn
On Saturday, 24 August 2024 at 12:35:03 UTC, Nicol Farran Terra wrote: On Saturday, 24 August 2024 at 12:29:41 UTC, IchorDev wrote: On Saturday, 24 August 2024 at 12:24:04 UTC, Nicol Farran Terra wrote: On Saturday, 24 August 2024 at 12:11:03 UTC, IchorDev wrote: snip snip2 That isvery

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread Nicol Farran Terra via Digitalmars-d-learn
On Saturday, 24 August 2024 at 12:29:41 UTC, IchorDev wrote: On Saturday, 24 August 2024 at 12:24:04 UTC, Nicol Farran Terra wrote: On Saturday, 24 August 2024 at 12:11:03 UTC, IchorDev wrote: snip snip2 That isvery helpful. So sort of like Swift, running the 'build' command will just

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread IchorDev via Digitalmars-d-learn
On Saturday, 24 August 2024 at 12:24:04 UTC, Nicol Farran Terra wrote: On Saturday, 24 August 2024 at 12:11:03 UTC, IchorDev wrote: snip Okay, yeah now I see my problem sort of. So now it at least builds, but it wont compile with dmd app.d. Says basically the same thing before where it canno

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread Nicol Farran Terra via Digitalmars-d-learn
On Saturday, 24 August 2024 at 12:11:03 UTC, IchorDev wrote: snip Okay, yeah now I see my problem sort of. So now it at least builds, but it wont compile with dmd app.d. Says basically the same thing before where it cannot find the module. Maybe I am supposed to link it? I am so used to doin

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread IchorDev via Digitalmars-d-learn
On Saturday, 24 August 2024 at 11:34:18 UTC, Nicol Farran Terra wrote: You are importing `google.protobuf`, right? Providing the app.d would be helpful, or at least a snippet of it with the import that’s giving you the ‘error’—presumably a compiler error? No, I am just importing 'pro

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-24 Thread Nicol Farran Terra via Digitalmars-d-learn
On Saturday, 24 August 2024 at 06:35:50 UTC, IchorDev wrote: On Saturday, 24 August 2024 at 00:24:12 UTC, Nicol Farran Terra wrote: I am not sure if this expected behavior, but importing this in my app.d does not work. I get an error about a missing import. You are importing `google.protobuf

Re: Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-23 Thread IchorDev via Digitalmars-d-learn
On Saturday, 24 August 2024 at 00:24:12 UTC, Nicol Farran Terra wrote: I am not sure if this expected behavior, but importing this in my app.d does not work. I get an error about a missing import. You are importing `google.protobuf`, right? Providing the app.d would be helpful, or at least a

Using D libraries with SDL. Error: "Cannot find module protobuf'

2024-08-23 Thread Nicol Farran Terra via Digitalmars-d-learn
es minimal, but I wanted to use protobuf for data serialization between the two. I am not sure if this expected behavior, but importing this in my app.d does not work. I get an error about a missing import. I ran to my 'root' where my dub.sdl was, ran the build for the library whic

Re: How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread evilrat via Digitalmars-d-learn
p; Debug DUB project", "cwd": "${command:dubWorkingDirectory}", "program": "${command:dubTarget}" } ] } ``` I've tried both DUB vs non-DUB launch config. Same error either way. So how do you guys efficiently debug D if there exists no working environment or is there a nice IDE I'm unaware of? In windows you need "C++" extension from Microsoft as it has native debugger for that OS.

Re: How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread IchorDev via Digitalmars-d-learn
On Monday, 19 August 2024 at 10:59:33 UTC, Daniel Donnelly, Jr. wrote: So how do you guys efficiently debug D if there exists no working environment or is there a nice IDE I'm unaware of? Use gdb; unless you’re running macOS, in which case use the version of lldb included in the macOS develope

Re: How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread ryuukk_ via Digitalmars-d-learn
How do I get LLDB to work? This is why i asked you what OS you use, but you didn't answer Click on the link bellow the screenshot and follow the doc And post log about errors you encounter, otherwise i can't help you, i am not on your PC

Re: How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread Daniel via Digitalmars-d-learn
On Monday, 19 August 2024 at 13:05:55 UTC, ryuukk_ wrote: What's your OS? Debugging works very nice with vscode: ```json { "name": "game: client", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/bin/game",

Re: How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread ryuukk_ via Digitalmars-d-learn
What's your OS? Debugging works very nice with vscode: ```json { "name": "game: client", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/bin/game", "cwd": "${workspaceFolder}/bin", }, ``` use: http

How do you typically debug / write D code (Visual Studio - known to be broken in Error pane etc), VScode - I get this error...

2024-08-19 Thread Daniel via Digitalmars-d-learn
ons": [ { "type": "code-d", "request": "launch", "dubBuild": true, "name": "Build & Debug DUB project", "cwd": "${command:dubWorkingDirectory}",

Re: inportC with postgres 16_4 on macOS error

2024-08-08 Thread Dakota via Digitalmars-d-learn
On Thursday, 8 August 2024 at 10:08:18 UTC, Dakota wrote: dmd v2.110.0-beta.1 ```c #if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE) FILE*fopen(const char * __restrict __filename, const char * __restrict __mode) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DAR

inportC with postgres 16_4 on macOS error

2024-08-08 Thread Dakota via Digitalmars-d-learn
dmd v2.110.0-beta.1 ```sh /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h(145): Error: found `__filename` when expecting `,` /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr

importC error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h(168): Error: variable `lib_test.mach_vm_range_recipe_v1_t.ra

2024-08-07 Thread Dakota via Digitalmars-d-learn
```sh /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h(168): Error: variable `lib_test.mach_vm_range_recipe_v1_t.range` - no definition of struct `mach_vm_range` /Applications/Xcode.app/Contents/Developer/Platforms

importC error: alignment value expected, not `sizeof`

2024-08-07 Thread Dakota via Digitalmars-d-learn
```c typedef struct test_s { unsigned char _[64] __attribute__ ((aligned (sizeof (void *; } test_t; ```

Re: importC error: can not find the #define ERR_INVALID -1

2024-08-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 3 August 2024 at 05:07:55 UTC, Dakota wrote: ```c #define ERR_SUCCESS 0 #define ERR_INVALID -1 // invalid argument ``` If the number >=0, it work. < 0 will not work. DMD64 D Compiler v2.110.0-beta.1 https://issues.dlang.org/show_bug.cgi?id=24639 -Steve

importC error: can not find the #define ERR_INVALID -1

2024-08-02 Thread Dakota via Digitalmars-d-learn
```c #define ERR_SUCCESS 0 #define ERR_INVALID -1 // invalid argument ``` If the number >=0, it work. < 0 will not work. DMD64 D Compiler v2.110.0-beta.1

Re: Error: circular reference to variable cause by order (bugs?)

2024-07-18 Thread monkyyy via Digitalmars-d-learn
On Thursday, 18 July 2024 at 12:25:37 UTC, Dakota wrote: I am trying to translate some c code into d, get this error: ```d struct A { void* sub; } struct B { void* subs; } __gshared { const A[1] a0 = [ { &b1_ptr }, ]; const A[2

Error: circular reference to variable cause by order (bugs?)

2024-07-18 Thread Dakota via Digitalmars-d-learn
I am trying to translate some c code into d, get this error: ```d struct A { void* sub; } struct B { void* subs; } __gshared { const A[1] a0 = [ { &b1_ptr }, ]; const A[2] a1 = [ { &b1_ptr }, ]; co

odbc error Im008 sql server :(

2024-07-01 Thread alina via Digitalmars-d-learn
hello people I need help to connect to sqlserver this is my code and that is the error returned ``` import odbc.sql; import odbc.sqlext; import odbc.sqlucode; import odbc.sqltypes; import std.stdio; import std.string : fromStringz, toStringz; version(Windows) { string connectionString

Re: 12 line program... `main` is a nested function when trying to use redblacktree. Beginner error???

2024-06-27 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jun 27, 2024 at 10:14:06PM +, WhatMeWorry via Digitalmars-d-learn wrote: > Thanks, that did the trick. Not sure why having the declarations at > global scope (or is it module scope in D) would work versus having > them at local scope? If you stuck 'static' to the local scope declarati

Re: 12 line program... `main` is a nested function when trying to use redblacktree. Beginner error???

2024-06-27 Thread WhatMeWorry via Digitalmars-d-learn
Thanks, that did the trick. Not sure why having the declarations at global scope (or is it module scope in D) would work versus having them at local scope?

Re: 12 line program... `main` is a nested function when trying to use redblacktree. Beginner error???

2024-06-27 Thread H. S. Teoh via Digitalmars-d-learn
oc, uint f) { > this.loc = loc; > this.f = f; > } > Location loc; > uint f; > } > > auto priorityQueue = new RedBlackTree!(Node, "a.f < b.f", true); // true: > allowDuplicates > > // C:\D\dmd2\win

12 line program... `main` is a nested function when trying to use redblacktree. Beginner error???

2024-06-27 Thread WhatMeWorry` via Digitalmars-d-learn
RedBlackTree!(Node, "a.f < b.f", true); // true: allowDuplicates // C:\D\dmd2\windows\bin64\..\..\src\phobos\std\container\rbtree.d(806): Error: `main` is // a nested function and cannot be accessed from // `std.container.rbtree.RedBlackTree!(Node, "a.f < b.f", t

Re: Why is this happening to my software? An illegal instruction error.

2024-06-26 Thread Sergey via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 23:07:47 UTC, Murilo wrote: I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and her

Re: Why is this happening to my software? An illegal instruction error.

2024-06-26 Thread Timon Gehr via Digitalmars-d-learn
On 6/19/24 01:07, Murilo wrote: I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and here is the message: Progr

Re: importC Error: undefined identifier `__atomic_thread_fence`

2024-06-23 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, June 21, 2024 12:39:44 PM MDT mw via Digitalmars-d-learn wrote: > Looks like `__atomic_thread_fence` is a GCC built-in function, so > how to make importC recognize it? dmd cannot handle it. gcc or ldc might, but dmd generally needs standard C code. Stuff like gcc built-ins basically has

importC Error: undefined identifier `__atomic_thread_fence`

2024-06-21 Thread mw via Digitalmars-d-learn
Looks like `__atomic_thread_fence` is a GCC built-in function, so how to make importC recognize it? Thanks.

Re: Why is this happening to my software? An illegal instruction error.

2024-06-20 Thread Basile B. via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 23:07:47 UTC, Murilo wrote: I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and her

Re: Why is this happening to my software? An illegal instruction error.

2024-06-19 Thread Murilo via Digitalmars-d-learn
On Wednesday, 19 June 2024 at 00:02:38 UTC, H. S. Teoh wrote: Among the above causes, I'd say (1) is the most likely, (2) is the 2nd most likely if (1) isn't the cause. Thank you, I will try this software on other computers to see if it's number 2. I've reviewed the code and I don't think it

Re: Why is this happening to my software? An illegal instruction error.

2024-06-19 Thread Murilo via Digitalmars-d-learn
On Wednesday, 19 June 2024 at 07:46:07 UTC, ryuukk_ wrote: why do you convert the number to string? My mistake, I thought BigInt() only took strings, I've corrected the code.

Re: Why is this happening to my software? An illegal instruction error.

2024-06-19 Thread ryuukk_ via Digitalmars-d-learn
On Tuesday, 18 June 2024 at 23:07:47 UTC, Murilo wrote: I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and her

Re: Why is this happening to my software? An illegal instruction error.

2024-06-18 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jun 18, 2024 at 11:07:47PM +, Murilo via Digitalmars-d-learn wrote: > I've created a software which performs the Fermat's Primality Test, > however if I input a very big number it causes an error saying > "Illegal instruction (core dumped)". Does anyone kno

Why is this happening to my software? An illegal instruction error.

2024-06-18 Thread Murilo via Digitalmars-d-learn
I've created a software which performs the Fermat's Primality Test, however if I input a very big number it causes an error saying "Illegal instruction (core dumped)". Does anyone know why? I've used GDB and here is the message: Program received signal SI

Re: Trying to call some C code using Extern(C) but got unexpected linker error

2024-06-08 Thread Basile B. via Digitalmars-d-learn
On Saturday, 8 June 2024 at 02:22:00 UTC, Xiaochao Yan wrote: Hi, I am new to D and is experimenting with game development using D and C. I had some problem when trying to recreate the https://dlang.org/spec/importc.html [...] Thanks in advance! on a recent compiler this should work: ```d

Re: Trying to call some C code using Extern(C) but got unexpected linker error

2024-06-07 Thread Steven Schveighoffer via Digitalmars-d-learn
-W64 project) 8.1.0 Error Message: ``` lld-link: error: undefined symbol: _D4test4mainFZ12printMessageUZv referenced by test.obj:(_Dmain) ``` ``` // .c file #include void printMessage() { printf("Hello from C!\n"); } ``` ``` // .d file import std.stdio; import std.conv; i

Trying to call some C code using Extern(C) but got unexpected linker error

2024-06-07 Thread Xiaochao Yan via Digitalmars-d-learn
Hi, I am new to D and is experimenting with game development using D and C. I had some problem when trying to recreate the https://dlang.org/spec/importc.html Environment: Windows 11 gcc.exe (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0 Error Message: ``` lld-link: error

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-14 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 15/04/2024 10:36 AM, Liam McGillivray wrote: Well, it did work when I tried it (using a string variable, not a literal of course). It displayed as it is supposed to. But from the information I can find on the web it looks like strings are sometimes but not |always| zero-terminated. Not a gre

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On Sunday, 14 April 2024 at 22:36:18 UTC, Liam McGillivray wrote: On Friday, 12 April 2024 at 15:24:38 UTC, Steven Schveighoffer wrote: ```d void InitWindow(int width, int height, ref string title) { InitWindow(width, height, cast(const(char)*)title); } ``` This is invalid, a string may no

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-14 Thread Liam McGillivray via Digitalmars-d-learn
On Friday, 12 April 2024 at 15:24:38 UTC, Steven Schveighoffer wrote: ```d void InitWindow(int width, int height, ref string title) { InitWindow(width, height, cast(const(char)*)title); } ``` This is invalid, a string may not be zero-terminated. You can't just cast. Well, it did work whe

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On Friday, 12 April 2024 at 00:04:48 UTC, Liam McGillivray wrote: Here's what I wanted to do. In the library I'm working on, there are various declarations for functions defined in an external C library following the line `extern (C) @nogc nothrow:`. Here are some examples of such declaration

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-11 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 9 April 2024 at 12:45:55 UTC, Richard (Rikki) Andrew Cattermole wrote: On 09/04/2024 12:48 PM, Liam McGillivray wrote: I suppose this was a good new thing to learn, though I'm still quite far from being able to construct a function from another function using a template. I suppo

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-10 Thread Steven Schveighoffer via Digitalmars-d-learn
function is being used for both, and hence uses GC (appending). Are you sure that string appending was really the problem that caused the "TypeInfo" build error? I forgot about this, but I had already had a working CTFE function with string appending before adding the new one that le

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-10 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 10/04/2024 2:50 PM, Liam McGillivray wrote: On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew Cattermole wrote: The string mixin triggers CTFE, if ``EnumPrefixes`` wasn't templated, that would cause codegen and hence error. If you called it in a context that wasn't

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 9 April 2024 at 23:50:36 UTC, Richard (Rikki) Andrew Cattermole wrote: The string mixin triggers CTFE, if ``EnumPrefixes`` wasn't templated, that would cause codegen and hence error. If you called it in a context that wasn't CTFE only, it would codegen even with template

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
string appending was really the problem that caused the "TypeInfo" build error? I forgot about this, but I had already had a working CTFE function with string appending before adding the new one that lead to this error. The symbols that it generates could be used in the program com

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Liam McGillivray via Digitalmars-d-learn
caused the "TypeInfo" build error? I forgot about this, but I had already had a working CTFE function with string appending before adding the new one that lead to this error. The symbols that it generates could be used in the program compiled with `betterC`. ``` string EnumPrefixes(T)(stri

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/04/2024 12:48 PM, Liam McGillivray wrote: On Tuesday, 9 April 2024 at 00:02:02 UTC, Richard (Rikki) Andrew Cattermole wrote: ```d enum Value = (a, b) { return a + b; }(1, 2); ``` This alone should be a CTFE only function. But if we want template parameters, we'd need to wrap it wit

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-09 Thread Kagamin via Digitalmars-d-learn
On Sunday, 7 April 2024 at 06:46:39 UTC, Liam McGillivray wrote: instantiated from here: `front!char` Looks like autodecoding, try to comment `canFind`.

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-08 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 9 April 2024 at 00:02:02 UTC, Richard (Rikki) Andrew Cattermole wrote: ```d enum Value = (a, b) { return a + b; }(1, 2); ``` This alone should be a CTFE only function. But if we want template parameters, we'd need to wrap it with the template. ```d template Value(int a, i

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-08 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 09/04/2024 11:42 AM, Liam McGillivray wrote: On Monday, 8 April 2024 at 08:12:22 UTC, Richard (Rikki) Andrew Cattermole wrote: ```d template Foo(Args) { enum Foo = () {     return Args.init; }(); } ``` Something like that should work instead. I'm sorry, but I can't comprehend

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-08 Thread Liam McGillivray via Digitalmars-d-learn
so, it didn't work. Making such a replacement resulted in the same "TypeInfo" error that I had already.

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-08 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 08/04/2024 10:45 AM, Liam McGillivray wrote: On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew Cattermole wrote: Unfortunately runtime and CTFE are the same target in the compiler. :-( Will this ever be changed? A tad unlikely, it would be a rather large change architectural

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-07 Thread Liam McGillivray via Digitalmars-d-learn
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew Cattermole wrote: Unfortunately runtime and CTFE are the same target in the compiler. :-( Will this ever be changed? ```d template Foo(Args) { enum Foo = () { return Args.init; }(); } ``` Somethin

Re: "Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-07 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Unfortunately runtime and CTFE are the same target in the compiler. So that function is being used for both, and hence uses GC (appending). ```d template Foo(Args) { enum Foo = () { return Args.init; }(); } ``` Something like that should work instead.

"Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

2024-04-06 Thread Liam McGillivray via Digitalmars-d-learn
have found that it results in the library no longer supporting `-betterC`. The compiler gives the following error. ``` /usr/include/dlang/dmd/core/lifetime.d(2760,42): Error: `TypeInfo` cannot be used with -betterC /usr/include/dlang/dmd/std/utf.d(1556,24):instantiated from

Re: Dub generated a visuald project for me that includes pegged + dqt (Qt widgets). Basic linking error fix?

2024-03-31 Thread Daniel via Digitalmars-d-learn
I see now. https://github.com/tim-dlang/dqt has examples of where these libs are found within Qt itself.

Dub generated a visuald project for me that includes pegged + dqt (Qt widgets). Basic linking error fix?

2024-03-31 Thread Daniel via Digitalmars-d-learn
``` Build started at 7:16 PM... -- Build started: Project: d--, Configuration: debug x64 -- Building C:\Users\fruit\OneDrive\Desktop\Code\StateMachine\D--\d--.exe... LINK : fatal error LNK1181: cannot open input file 'Qt5Widgets.lib' Building C:\Users\fruit\OneDrive\De

Re: LDC Internal Compiler Error (ICE) mentioning attribute 'nocapture'

2024-03-31 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 March 2024 at 09:35:24 UTC, Per Nordlöw wrote: Does anybody recognize the error ``` Attribute 'nocapture' does not apply to function return values %12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull %10, { i64, ptr } %11) #2, !dbg !7978 Attribute '

LDC Internal Compiler Error (ICE) mentioning attribute 'nocapture'

2024-03-30 Thread Per Nordlöw via Digitalmars-d-learn
Does anybody recognize the error ``` Attribute 'nocapture' does not apply to function return values %12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull %10, { i64, ptr } %11) #2, !dbg !7978 Attribute 'nocapture' does not apply to function return values pt

Re: range.chunks(2) error

2024-03-28 Thread Salih Dincer via Digitalmars-d-learn
On Thursday, 28 March 2024 at 17:50:17 UTC, Salih Dincer wrote: Hi, When I use the chunks() template with iota(), for instance, with chunks(2), I can access both r.front and r.back. However, in a range of my own type (named iras in the code below), only r.front is working. I think the error

range.chunks(2) error

2024-03-28 Thread Salih Dincer via Digitalmars-d-learn
Hi, When I use the chunks() template with iota(), for instance, with chunks(2), I can access both r.front and r.back. However, in a range of my own type (named iras in the code below), only r.front is working. I think the error given by r.back is not a bug related to chunks, is it? ```d

Re: request assistance resolving curl error

2024-03-27 Thread confuzzled via Digitalmars-d-learn
On 3/26/24 8:44 PM, Andrea Fontana wrote: On Tuesday, 26 March 2024 at 07:13:24 UTC, confuzzled wrote: I think you should use the HTTP interface, did you check this docs? https://dlang.org/phobos/std_net_curl.html#.HTTP https://dlang.org/phobos/std_net_curl.html#.HTTP.addRequestHeader Andrea

Re: request assistance resolving curl error

2024-03-26 Thread Andrea Fontana via Digitalmars-d-learn
On Tuesday, 26 March 2024 at 07:13:24 UTC, confuzzled wrote: Hello all, I have two scripts. I copied the first directly from the alpaca website and massaged it with etc.c.curl until it compiled in D. The result is that it creates the order and returns the result to stdout. In the second scrip

request assistance resolving curl error

2024-03-26 Thread confuzzled via Digitalmars-d-learn
dless of what I pass to it, nothing works. I tried to not setting it but that didn't work either. Don't know if that is even an option since alpaca_c did not work without it and resulted in the same error `{"code":4001,"message":"request body format is inv

Re: DUB error I can't make sense of

2024-03-16 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 16 March 2024 at 07:27:17 UTC, Richard (Rikki) Andrew Cattermole wrote: Do you? ``module nxt.algorithm.comparsion;`` comparsion doesn't look much like comparison to me ;) I know. I'm crushed. Am I getting dislyctic? ;)

Re: DUB error I can't make sense of

2024-03-16 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 16 March 2024 at 07:23:09 UTC, Per Nordlöw wrote: Do you? Fixed it. There was some invisible character that confused the compiler.

Re: DUB error I can't make sense of

2024-03-16 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 16/03/2024 8:23 PM, Per Nordlöw wrote: https://github.com/nordlow/phobos-next/releases/tag/v0.6.10 fails to build as ``` ../../.dub/cache/phobos-next/0.6.10/code/phobos-next-test-library-unittest-nyN4MEoglVgAJ1A9GyL6uA/dub_test_root.d(11,15): Error: module `nxt.algorithm.comparsion` from

DUB error I can't make sense of

2024-03-16 Thread Per Nordlöw via Digitalmars-d-learn
https://github.com/nordlow/phobos-next/releases/tag/v0.6.10 fails to build as ``` ../../.dub/cache/phobos-next/0.6.10/code/phobos-next-test-library-unittest-nyN4MEoglVgAJ1A9GyL6uA/dub_test_root.d(11,15): Error: module `nxt.algorithm.comparsion` from file src/nxt/algorithm/comparison.d must be

Re: Error when using `import`.

2024-03-05 Thread Liam McGillivray via Digitalmars-d-learn
There's something that I'm trying to do that D may or may not be capable of. In the Map class, there is a 2-dimensional array called `grid`, where the Tile objects are stored. The Mission class inherits the Map class. In the Mission class, I want the `grid` array to instead be composed of a

Re: Error when using `import`.

2024-03-05 Thread Liam McGillivray via Digitalmars-d-learn
I have made some progress on this. For the raylib front-end, I tried making a class called `Mission` which inherits `Map`. This class handles the graphics, input, and other game events. The program now compiles without errors, and there are some graphics. I have pushed these updates to the GitH

Re: Error when using `import`.

2024-03-01 Thread monkyyy via Digitalmars-d-learn
On Friday, 1 March 2024 at 05:07:24 UTC, Liam McGillivray wrote: I don't know how best to organize the code. So far I have been oo ideas for a 2nd opinion: https://github.com/crazymonkyyy/raylib-2024/blob/master/docs/examplecode.md Theres not a good learning resource but "data oirented desig

Re: Error when using `import`.

2024-02-29 Thread Liam McGillivray via Digitalmars-d-learn
I now have the Raylib functions working by using `toStrinz`. I pushed some updates to the repository. I made the main project a source library so that I can experiment with different graphics library front-ends. I put have the front-end using Raylib in the `raylib_frontend` directory. It doesn

Re: Error when using `import`.

2024-02-28 Thread Danilo via Digitalmars-d-learn
Examples were moved, so it‘s in the same place now: - https://github.com/schveiguy/raylib-d - https://github.com/schveiguy/raylib-d_examples

Re: Error when using `import`.

2024-02-28 Thread Danilo via Digitalmars-d-learn
On Wednesday, 28 February 2024 at 07:56:16 UTC, Liam McGillivray wrote: ``` DrawText("Open Emblem", 180, 300, 64, Colors.RAYWHITE); ``` So why is it that one of these functions, but not the other is allowing D strings in place of C-style strings? C is expecting null-terminated chars. D strin

Re: Error when using `import`.

2024-02-28 Thread Liam McGillivray via Digitalmars-d-learn
There's something very strange going on when using Raylib-D. I tried using the raylib function `LoadTexture` like this: ``` tileSprites[i] = LoadTexture("../sprites/" ~ spriteName); ``` I got the following error: ``` Error: function `raylib.LoadTexture(const(char)* fileName)` i

Re: Error when using `import`.

2024-02-27 Thread Danilo via Digitalmars-d-learn
On Tuesday, 27 February 2024 at 22:05:48 UTC, Liam McGillivray wrote: Looking at the code examples on the Raylib and SFML website, they look similar in complexity of getting started, but I like it that the Raylib website has lots of simple demonstration programs on the website with the code pro

Re: Error when using `import`.

2024-02-27 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 27 February 2024 at 03:43:56 UTC, Liam McGillivray wrote: Raylib looks promising. I installed it along with your Raylib-d. I managed to build the example you provided with dub, but trying to use it in it's own dub project in a separate directory isn't working. Just copying and pasti

Re: Error when using `import`.

2024-02-26 Thread Liam McGillivray via Digitalmars-d-learn
On Tuesday, 27 February 2024 at 03:06:19 UTC, Steven Schveighoffer wrote: If you are going for game development, I would recommend raylib-d (https://code.dlang.org/packages/raylib-d), which is my wrapper around the very good raylib library. For doing GUI, raygui is supported, but I also can sa

Re: Error when using `import`.

2024-02-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On Monday, 26 February 2024 at 23:27:49 UTC, Liam McGillivray wrote: I don't know whether I should continue this topic or start a new one now that the problem mentioned in the title is fixed. I have now uploaded some of the code to [a GitHub repository](https://github.com/LiamM32/Open_Emblem).

Re: Error when using `import`.

2024-02-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On Monday, 26 February 2024 at 22:40:49 UTC, Liam McGillivray wrote: On Sunday, 25 February 2024 at 03:23:03 UTC, Paul Backus wrote: You can't give a class the same name as the file it's in. If you do, then when you try to use it from another file, the compiler will get confused and think you'r

Re: Error when using `import`.

2024-02-26 Thread Liam McGillivray via Digitalmars-d-learn
I don't know whether I should continue this topic or start a new one now that the problem mentioned in the title is fixed. I have now uploaded some of the code to [a GitHub repository](https://github.com/LiamM32/Open_Emblem). To make this game usable, I will need a library for graphics and in

Re: Error when using `import`.

2024-02-26 Thread Liam McGillivray via Digitalmars-d-learn
On Sunday, 25 February 2024 at 03:23:03 UTC, Paul Backus wrote: You can't give a class the same name as the file it's in. If you do, then when you try to use it from another file, the compiler will get confused and think you're referring to the file instead of the class (that's what "import is

Re: importC error Error: undefined identifier `__builtin_unreachable`

2024-02-26 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 26/02/2024 10:34 PM, Dakota wrote: undefined identifier `__builtin_clz` Done. https://issues.dlang.org/show_bug.cgi?id=24414

Re: importC error Error: undefined identifier `__builtin_unreachable`

2024-02-26 Thread Dakota via Digitalmars-d-learn
On Monday, 26 February 2024 at 08:18:53 UTC, Richard (Rikki) Andrew Cattermole wrote: On 26/02/2024 9:04 PM, Dakota wrote: I try one more importC case, get this error: ```sh Error: undefined identifier `__builtin_unreachable` ``` any tips to fix this? Reported: https://issues.dlang.org

Re: importC error Error: undefined identifier `__builtin_unreachable`

2024-02-26 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 26/02/2024 9:04 PM, Dakota wrote: I try one more importC case, get this error: ```sh Error: undefined identifier `__builtin_unreachable` ``` any tips to fix this? Reported: https://issues.dlang.org/show_bug.cgi?id=24413

importC error Error: undefined identifier `__builtin_unreachable`

2024-02-26 Thread Dakota via Digitalmars-d-learn
I try one more importC case, get this error: ```sh Error: undefined identifier `__builtin_unreachable` ``` any tips to fix this?

Re: Error when using `import`.

2024-02-24 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 24 February 2024 at 10:31:06 UTC, Liam McGillivray wrote: `Unit.d` & `Map.d` are longer files. `Map.d` begins with `import Tile;`, and `Unit.d` begins with `import Map;`. Why are the errors happening? What's the problem? Why is it `currentclass.importedclass` instead of simply t

Re: Error when using `import`.

2024-02-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 24/02/2024 11:51 PM, Liam McGillivray wrote: On Saturday, 24 February 2024 at 10:34:25 UTC, Richard (Rikki) Andrew Cattermole wrote: A few things. Module names should be lower case. I capitalised the first letter in the class names so that I can make instances of them in lowercase. Shou

Re: Error when using `import`.

2024-02-24 Thread Liam McGillivray via Digitalmars-d-learn
On Saturday, 24 February 2024 at 10:34:25 UTC, Richard (Rikki) Andrew Cattermole wrote: A few things. Module names should be lower case. I capitalised the first letter in the class names so that I can make instances of them in lowercase. Should I rename the classes, modules, and filenames to

  1   2   3   4   5   6   7   8   9   10   >