delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/02/04/07:34:41

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <2284342f0802040433m6f78becdj487e29b5c45ea315@mail.gmail.com>
Date: Mon, 4 Feb 2008 07:33:57 -0500
From: "Doug Bohl" <douglas DOT bohl AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: porting Unix programs to windows
In-Reply-To: <927674.8014.qm@web15804.mail.cnb.yahoo.com>
MIME-Version: 1.0
References: <927674 DOT 8014 DOT qm AT web15804 DOT mail DOT cnb DOT yahoo DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

You need to clarify what you mean by "port Unix C programs to Windows
VC using cygwin" means.  As Brian has pointed out, Cygwin's headers
are written for Cygwin's libraries, just as MSVC's headers are written
for MSVC's libraries.

You'll find that it's quite easy to port UNIX programs using Cygwin's
automake, gcc, and so forth, provided you have the necessary
dependencies installed.

In what way are you porting "to Windows VC"?  To me that means you
either (a) want the program to link to the Microsoft Visual C++
Runtime Library, or (b) you do not want the program to link to the
Microsoft Visual C++ Runtime Library.

My recommendation: Use MSVC as an IDE only.  Go into MSVC and make
sure that the paths to the compiler, linker, assembler, preprocessor,
etc., etc., etc., includes, libs, etc., etc., are all cygwin.  You
might even be able to get MSVC to use /bin/make.

On Feb 3, 2008 4:15 PM, Wei Le <weiapplele AT yahoo DOT com DOT cn> wrote:
> Hello,
>
> I tried to port Unix C programs to Windows VC using
> cygwin. I hope the programs can be compiled and linked
> correctly under VC. However,  it does not require that
> the programs run correctly.
>
> As the first step, I tried the compilation. I added
> sys/cygwin.h to the beginning of the unix C program.
> VC compiler reports errors:
> .. \iquery\iquery.cpp(100) : error C2660: 'printf' :
> function does not take 1 arguments
> .. \iquery\iquery.cpp(111) : error C2660: 'printf' :
> function does not take 1 arguments
> .. \iquery\iquery.cpp(134) : error C2660: 'printf' :
> function does not take 3 arguments
> .. \iquery\iquery.cpp(136) : error C2660: 'memcpy' :
> function does not take 3 arguments
>
> I added a statement "printf();" to the program as a
> test, the compiler does not complain about that
> "printf" that do not have any paramters.
>
> What can I do to fix those compilation errors?
>
> Thanks.
>
> Wei
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019