public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Want to build Win32 API code and Posix API code in Cygwin
@ 2014-02-24 10:05 Qw Liu
  2014-02-24 13:30 ` Andrey Repin
  0 siblings, 1 reply; 3+ messages in thread
From: Qw Liu @ 2014-02-24 10:05 UTC (permalink / raw)
  To: cygwin

Hi All,
    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?
    Thanks a lot for your guidance!

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Want to build Win32 API code and Posix API code in Cygwin
  2014-02-24 10:05 Want to build Win32 API code and Posix API code in Cygwin Qw Liu
@ 2014-02-24 13:30 ` Andrey Repin
  2014-02-25  6:11   ` Qw Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Repin @ 2014-02-24 13:30 UTC (permalink / raw)
  To: Qw Liu, cygwin

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@yandex.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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Want to build Win32 API code and Posix API code in Cygwin
  2014-02-24 13:30 ` Andrey Repin
@ 2014-02-25  6:11   ` Qw Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Qw Liu @ 2014-02-25  6:11 UTC (permalink / raw)
  To: cygwin, anrdaemon

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@yandex.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@yandex.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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-25  2:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 10:05 Want to build Win32 API code and Posix API code in Cygwin Qw Liu
2014-02-24 13:30 ` Andrey Repin
2014-02-25  6:11   ` Qw Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).