digitalmars.D.learn - dmd error - unrecognized file extension
- Evan Burkey (12/12) Jan 29 2018 Hi there, I have a problem that is eluding me, hoping someone can
- rjframe (9/25) Jan 29 2018 I have the same issue on Windows 10, but Linux works; have you checked t...
- Evan Burkey (8/35) Jan 29 2018 So I played around with it a bit more and discovered what the
- Steven Schveighoffer (5/11) Jan 29 2018 version is a keyword, you can't use it here like this. Not sure if this
- H. S. Teoh (9/21) Jan 29 2018 [...]
- Evan Burkey (5/8) Jan 29 2018 So I tried changing the name to "v.txt" and had the same results:
- =?UTF-8?Q?Ali_=c3=87ehreli?= (5/13) Jan 29 2018 It's the other "version". :) You can't use a keyword as a symbol:
Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: immutable version = import("version.txt"); and my dmd switches are: dmd -J. .\versioncheck.d but dmd fails with "Error: unrecognized file extension". I've searched the internet but found very little about this problem. Hopefully I'm just missing something simple. Thanks!
Jan 29 2018
On Mon, 29 Jan 2018 17:25:34 +0000, Evan Burkey wrote:Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: immutable version = import("version.txt"); and my dmd switches are: dmd -J. .\versioncheck.d but dmd fails with "Error: unrecognized file extension". I've searched the internet but found very little about this problem. Hopefully I'm just missing something simple. Thanks!I have the same issue on Windows 10, but Linux works; have you checked the issue tracker yet? It looks like just `dmd -J .\versioncheck.d` should work [I haven't tested this properly with an actual string mixin, but I don't get that error this way]. On Windows, dmd doesn't seem to like starting with the period. So if it was in a different directory, instead of `dmd -J.\somedir` on Windows you'd need to just do `dmd -Jsomedir` --Ryan
Jan 29 2018
On Monday, 29 January 2018 at 18:02:47 UTC, rjframe wrote:On Mon, 29 Jan 2018 17:25:34 +0000, Evan Burkey wrote:So I played around with it a bit more and discovered what the problem was. I normally am a Linux/BSD user but am running a Win10 machine to test multi-platform compatibility. What I discovered is that the Windows version has a special command prompt called D2. I was using PowerShell (as that is this system's default shell). Once I used the special D2 prompt the Unix-style switches worked fine.Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: immutable version = import("version.txt"); and my dmd switches are: dmd -J. .\versioncheck.d but dmd fails with "Error: unrecognized file extension". I've searched the internet but found very little about this problem. Hopefully I'm just missing something simple. Thanks!I have the same issue on Windows 10, but Linux works; have you checked the issue tracker yet? It looks like just `dmd -J .\versioncheck.d` should work [I haven't tested this properly with an actual string mixin, but I don't get that error this way]. On Windows, dmd doesn't seem to like starting with the period. So if it was in a different directory, instead of `dmd -J.\somedir` on Windows you'd need to just do `dmd -Jsomedir` --Ryan
Jan 29 2018
On 1/29/18 12:25 PM, Evan Burkey wrote:Hi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: Â Â Â immutable version = import("version.txt");version is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it properly. -Steve
Jan 29 2018
On Mon, Jan 29, 2018 at 02:12:13PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote:On 1/29/18 12:25 PM, Evan Burkey wrote:[...] Granted, though, the error message could have been a lot more helpful than it is. As it stands, it didn't even occur to me that `version` being a keyword was the problem here until you pointed it out. That's a sign that the compiler error message needs improvement. :-) T -- Life is too short to run proprietary software. -- Bdale GarbeeHi there, I have a problem that is eluding me, hoping someone can help me see the light. I'm on Windows 10 using the latest version of dmd. I have a directory with 2 files: "version.txt" and "versioncheck.d". version.txt contains a single line of text. I have the line: immutable version = import("version.txt");version is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it properly.
Jan 29 2018
On Monday, 29 January 2018 at 19:12:13 UTC, Steven Schveighoffer wrote:version is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it properly.So I tried changing the name to "v.txt" and had the same results: PowerShell threw the same errors, but the D2 command prompt worked just fine.
Jan 29 2018
On 01/29/2018 12:53 PM, Evan Burkey wrote:On Monday, 29 January 2018 at 19:12:13 UTC, Steven Schveighoffer wrote:It's the other "version". :) You can't use a keyword as a symbol: immutable version = 1; // bad immutable version_ = 1; // good Aliversion is a keyword, you can't use it here like this. Not sure if this is related to your issue directly, but definitely it will show up as an error when the compiler looks at it properly.So I tried changing the name to "v.txt" and had the same results: PowerShell threw the same errors, but the D2 command prompt worked just fine.
Jan 29 2018