Thread overview | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
November 14, 2016 D with CygWin | ||||
---|---|---|---|---|
| ||||
Hello! I want to port my D application to Windows using CygWin. Is it possible? How? |
November 14, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | On Monday, 14 November 2016 at 12:24:17 UTC, unDEFER wrote:
> Hello!
> I want to port my D application to Windows using CygWin. Is it possible? How?
It is. I'd recommend MinGW, though. Else you will have to ship the cygwin.dll. However, you can compile your D app directly on windows with dmd/dub, depending on the app. What kinda application is it?
|
November 14, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris | On Monday, 14 November 2016 at 12:36:53 UTC, Chris wrote: > It is. I'd recommend MinGW, though. Else you will have to ship the cygwin.dll. However, you can compile your D app directly on windows with dmd/dub, depending on the app. What kinda application is it? I still think how to better port my application. The goal of the project is rewrite existing program environment entirely. But for beginning it will very original file manager and text/image viewer. The screenshot: https://drive.google.com/open?id=0ByWS85CFyRGwd3ZJd3RrQ01razA It is my "/". You can see "bin" with many files, "etc" with many other directories and files, and the most interesting - "proc" with many directories with the same structure. So the problem is that I'm using rsync to copy. And rsync ported to windows only with cygwin. And I think: make some rsync replacement for windows with reduced functionality or use cygwin for my program fully. Strange that all I can find on "cygwin.h" request is http://www.privoxy.org/dox/cygwin_8h-source.html So I still don't understand what means "ship cygwin.dll". |
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | Hello, again! I'm long have thought and have decided to try to do the next thing: I'm trying to list "/" of cygwin environment with the next code: =============================== import std.stdio; import cygwin.std.file; void main() { foreach (string name; dirEntries("/", SpanMode.shallow)) { writefln(name); } } =============================== Where cygwin.std.file is std.file copied to cygwin directory with replacement "version (Windows)" to "version (WindowsNotWindows)", "version (Posix)"/"version(linux)"/"version(CRuntime_Glibc)" to "version (Windows)". Also I have copied all dependencies core.sys.posix to cygwin directory with the same replacement. I think that cygwin defines all posix functions, so the Posix code of D must works under Windows with cygwin libraries. But now I have the next linker error: =============================== $ dmd try.d OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file10dirEntriesFAyaE6cygwin3std4file8SpanModebZS6cygwin3std4file11DirIterator try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file8DirEntry4nameMxFNaNbNdZAya try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator8popFrontMFZv try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator5emptyMFNdZb try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator5frontMFNdZS6cygwin3std4file8DirEntry try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator11__fieldDtorMFZv try.obj(try) Error 42: Symbol Undefined _D6cygwin3std4file12__ModuleInfoZ Error: linker exited with status 177865064 =============================== And looks like these functions is not POSIX functions which I can find in cygwin-libraries. Any ideas? How to correctly use CygWin under D? |
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | On 18/11/2016 10:33 PM, unDEFER wrote:
> Hello, again!
> I'm long have thought and have decided to try to do the next thing:
> I'm trying to list "/" of cygwin environment with the next code:
>
> ===============================
> import std.stdio;
> import cygwin.std.file;
>
> void main()
> {
> foreach (string name; dirEntries("/", SpanMode.shallow))
> {
> writefln(name);
> }
> }
> ===============================
>
> Where cygwin.std.file is std.file copied to cygwin directory with
> replacement "version (Windows)" to "version (WindowsNotWindows)",
> "version (Posix)"/"version(linux)"/"version(CRuntime_Glibc)" to "version
> (Windows)". Also I have copied all dependencies core.sys.posix to cygwin
> directory with the same replacement.
>
> I think that cygwin defines all posix functions, so the Posix code of D
> must works under Windows with cygwin libraries.
> But now I have the next linker error:
>
> ===============================
> $ dmd try.d
> OPTLINK (R) for Win32 Release 8.00.17
> Copyright (C) Digital Mars 1989-2013 All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> try.obj(try)
> Error 42: Symbol Undefined
> _D6cygwin3std4file10dirEntriesFAyaE6cygwin3std4file8SpanModebZS6cygwin3std4file11DirIterator
>
> try.obj(try)
> Error 42: Symbol Undefined _D6cygwin3std4file8DirEntry4nameMxFNaNbNdZAya
> try.obj(try)
> Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator8popFrontMFZv
> try.obj(try)
> Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator5emptyMFNdZb
> try.obj(try)
> Error 42: Symbol Undefined
> _D6cygwin3std4file11DirIterator5frontMFNdZS6cygwin3std4file8DirEntry
> try.obj(try)
> Error 42: Symbol Undefined
> _D6cygwin3std4file11DirIterator11__fieldDtorMFZv
> try.obj(try)
> Error 42: Symbol Undefined _D6cygwin3std4file12__ModuleInfoZ
> Error: linker exited with status 177865064
> ===============================
>
> And looks like these functions is not POSIX functions which I can find
> in cygwin-libraries. Any ideas?
> How to correctly use CygWin under D?
Perhaps you should treat it as a port to a new platform.
So start with getting druntime going (which means recompiling it).
|
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Friday, 18 November 2016 at 09:40:25 UTC, rikki cattermole wrote:
> Perhaps you should treat it as a port to a new platform.
> So start with getting druntime going (which means recompiling it).
No, no recompile. The idea is very simple:
1. The cygwin provides libraries
2. I can rewrite dirEntries() using functions from cygwin. The posibility is provided by D language and not by runtime.
3. Profit
What I'm understand wrong? Why simple using of cygwin-libraries can require druntime recompile?
|
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | On Friday, 18 November 2016 at 09:33:58 UTC, unDEFER wrote: > =============================== > $ dmd try.d > OPTLINK (R) for Win32 Release 8.00.17 > Copyright (C) Digital Mars 1989-2013 All rights reserved. > http://www.digitalmars.com/ctg/optlink.html > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file10dirEntriesFAyaE6cygwin3std4file8SpanModebZS6cygwin3std4file11DirIterator > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file8DirEntry4nameMxFNaNbNdZAya > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator8popFrontMFZv > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator5emptyMFNdZb > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator5frontMFNdZS6cygwin3std4file8DirEntry > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file11DirIterator11__fieldDtorMFZv > try.obj(try) > Error 42: Symbol Undefined _D6cygwin3std4file12__ModuleInfoZ > Error: linker exited with status 177865064 > =============================== Who can explain these symbols? _D6cygwin3std4file10dirEntriesFAyaE6cygwin3std4file8SpanModebZS6cygwin3std4file11DirIterator dirEntries, SpanMode, DirIterator. dirEntries is function and defined in the code, SpanMode is enum and defined in the code, DirIterator is struct and defined in the code. So why it needed in something more?? |
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | Dne 18.11.2016 v 10:53 unDEFER via Digitalmars-d napsal(a):
> On Friday, 18 November 2016 at 09:40:25 UTC, rikki cattermole wrote:
>> Perhaps you should treat it as a port to a new platform.
>> So start with getting druntime going (which means recompiling it).
>
> No, no recompile. The idea is very simple:
> 1. The cygwin provides libraries
> 2. I can rewrite dirEntries() using functions from cygwin. The posibility is provided by D language and not by runtime.
> 3. Profit
>
> What I'm understand wrong? Why simple using of cygwin-libraries can require druntime recompile?
No it does not require it. Your error seems like you do not links against your cygwin stdio, where do you place your cygwin.std.* files? Did you rename module std.whatever to module cygwin.std.whatever ?
|
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to unDEFER | On 18/11/2016 10:53 PM, unDEFER wrote: > On Friday, 18 November 2016 at 09:40:25 UTC, rikki cattermole wrote: >> Perhaps you should treat it as a port to a new platform. >> So start with getting druntime going (which means recompiling it). > > No, no recompile. The idea is very simple: > 1. The cygwin provides libraries > 2. I can rewrite dirEntries() using functions from cygwin. The > posibility is provided by D language and not by runtime. > 3. Profit > > What I'm understand wrong? Why simple using of cygwin-libraries can > require druntime recompile? Cygwin is a massive platform, it isn't just a library. It is a full port of programs, libraries and who knows what else. Also you should read this, it pretty much sums up what I'm saying[0]. [0] https://cygwin.com/faq/faq.html#faq.programming.msvcrt-and-cygwin |
November 18, 2016 Re: D with CygWin | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Kozak | On Friday, 18 November 2016 at 10:04:28 UTC, Daniel Kozak wrote: > No it does not require it. Your error seems like you do not links against your cygwin stdio, where do you place your cygwin.std.* files? Did you rename module std.whatever to module cygwin.std.whatever ? Oh, you are right, it is so easy. Of couse not "dmd try.d", it must be "dmd `find . -iname "*.d"`". Look, so simply: ====================================== $ dmd `find . -iname "*.d"` OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html time.obj(time) Error 42: Symbol Undefined _fstat64 time.obj(time) Error 42: Symbol Undefined _open64 time.obj(time) Error 42: Symbol Undefined _stat64 time.obj(time) Error 42: Symbol Undefined _lstat64 time.obj(time) Error 42: Symbol Undefined _fchmod time.obj(time) Error 42: Symbol Undefined _closedir time.obj(time) Error 42: Symbol Undefined _readdir64 time.obj(time) Error 42: Symbol Undefined _opendir time.obj(time) Error 42: Symbol Undefined _readlink Error: linker exited with status 217443944 ======================================= A little bit more, and I will have this example working. I will upload my example.. |
Copyright © 1999-2021 by the D Language Foundation