| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:mime-version:in-reply-to:references:date | |
| :message-id:subject:from:to:content-type; q=dns; s=default; b=jd | |
| TEyeQ9gmb9z/3liIriTw6LNPxRKx+eMWJ2MuHbI83czm5xxs5y89hMnTF7u2g6X/ | |
| 6jwvV9bBOel5zJOcqABogc67whxXjui94SZk5jptlW/2AnDmM/3pV4yYs8nS+v8k | |
| zPXSd5ruAyYEkaIMq2b5EwvghtDXEMpbVMsYYup8E= | |
| DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
| :list-unsubscribe:list-subscribe:list-archive:list-post | |
| :list-help:sender:mime-version:in-reply-to:references:date | |
| :message-id:subject:from:to:content-type; s=default; bh=F25/nHi3 | |
| mpvwYWhbkJfuGSKSY44=; b=P90dp2MKPWOwAyWIlKzE/Js48LZ+QO0R8oIvvogB | |
| 9xls0XOJ7APLvqFmS3Nmy/7jY5mlzY0HvH7YLI9eAv4NQwY8zrgA18QmGDRFFccN | |
| MFxtGJdA2W1BtuWyBxA2hp27gxCAUksRFxQ+heuDaPnBZTvQNA0/8KbDblJbS0+Y | |
| 9CM= | |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Authentication-Results: | sourceware.org; auth=none |
| X-Virus-Found: | No |
| X-Spam-SWARE-Status: | No, score=4.5 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 |
| X-HELO: | mail-wg0-f53.google.com |
| MIME-Version: | 1.0 |
| X-Received: | by 10.194.89.33 with SMTP id bl1mr21310wjb.64.1393294178541; Mon, 24 Feb 2014 18:09:38 -0800 (PST) |
| In-Reply-To: | <304015319.20140224135538@yandex.ru> |
| References: | <CA+-2duzzdkkYiXirqo=7FVOkXgDyyUXLy3+3NNmF6UND9aLMcg AT mail DOT gmail DOT com> <304015319 DOT 20140224135538 AT yandex DOT ru> |
| Date: | Tue, 25 Feb 2014 10:09:38 +0800 |
| Message-ID: | <CA+-2duxR=f8FBuzOMqebPWgYNZTXs=vH4CvMprDDGWoaodGkuA@mail.gmail.com> |
| Subject: | Re: Want to build Win32 API code and Posix API code in Cygwin |
| From: | Qw Liu <liuqw093 AT gmail DOT com> |
| To: | cygwin AT cygwin DOT com, anrdaemon AT yandex DOT ru |
Hi Andrey,
Thanks for your patient answer. Actually the code is historic
legacy, and I want to have a quick try on Windows and reduce the
efforts as much as possible. Code part B mainly contains some device
operations, like serial port, ethernet config(not only socket), USB
detection, etc, code part A mainy contain process management and FS
operation, etc. I get "no tchar.h", "definition of gethostname
conflicts" like error when I build them together on Cygwin using GCC.
What is your advice under such situation? "Push all
platform-dependent code into a separate library" is another method I'm
trying for long-term resolution, but is there any approach I can have
a quick try w/o stbility and performance consideration?
Thanks a lot and appreciated for your reply!
2014-02-24 17:55 GMT+08:00 Andrey Repin <anrdaemon AT yandex DOT ru>:
> Greetings, Qw Liu!
>
>> I have legacy code (part A) written in Posix API that I want to
>> port to Windows, and there is also some other necessary code (part B)
>> written in Win32 API, but seems that I cannot use GCC on Cygwin to
>> build them (A and B) together to get the executable program, since I
>> met issue like "header missing" for Win32 API .
>> Is there any other method to resolve such problem? I considerred
>> to build part B as dll first and build with part A on Cygwin. Is that
>> okay?
>
> My Crystal Ball is in service - overheated again...
> WHAT header you are missing, exactly?
> And before you answer that, you do aware, that mixing POSIX and Windows native
> API calls is generally considered not a very good idea, right?
> Depends on the kind of mix (stirred, not shaken?), you may be on a very sharp
> edge of things.
> Without looking at your code, one possible solution is to push all
> platform-dependent code into a separate library, and load it at runtime.
>
>
> --
> WBR,
> Andrey Repin (anrdaemon AT yandex DOT ru) 24.02.2014, <13:49>
>
> Sorry for my terrible english...
>
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |