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

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

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

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: Searching for i" in the forum

2024-02-26 Thread cc via Digitalmars-d-learn
On Sunday, 25 February 2024 at 01:19:15 UTC, Lysander wrote: On Friday, 23 February 2024 at 23:18:12 UTC, kdevel wrote: How do I search for i" in the forum? I get the following errors: i" -> Error: malformed MATCH expression: [i"] (1) i\" -> Error: malformed MATCH expression: [i\"]

Re: need help with simple importC

2024-02-26 Thread Dakota via Digitalmars-d-learn
On Monday, 26 February 2024 at 07:44:02 UTC, Dakota wrote: I am use importC from linux, get this error: ```sh /usr/include/x86_64-linux-gnu/bits/floatn-common.h(214): Error: illegal combination of type specifiers /usr/include/x86_64-linux-gnu/bits/floatn-common.h(251): Error: illegal

Re: importC with gc-sections not work on linux

2024-02-26 Thread Dakota via Digitalmars-d-learn
On Monday, 26 February 2024 at 12:33:02 UTC, Richard (Rikki) Andrew Cattermole wrote: On 27/02/2024 1:28 AM, Dakota wrote: When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. This removes symbols, not

Re: importC with gc-sections not work on linux

2024-02-26 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 27/02/2024 1:28 AM, Dakota wrote: When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. This removes symbols, not keeps them. You want the linker flag: ``--no-gc-sections`` "Enable garbage collection

importC with gc-sections not work on linux

2024-02-26 Thread Dakota via Digitalmars-d-learn
When I use importC to build a c library, there is a lot unused symbol missing. I try add `-L--gc-sections` to dmd to workaround this issue. I also try `-L-dead_strip` on macOS, it work as expected. I do some google, some one suggestion use with `-ffunction-sections`, `-f fdata-sections`,

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:

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?