public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Porting OS/2 EMX __findfirst / __findnext
       [not found] <4.3.1.2.20000411100456.00d7c9d0@pop.ma.ultranet.com>
@ 2000-04-11  7:28 ` peter karlsson
  2000-04-11 12:14   ` Larry Hall (RFK Partners, Inc)
  0 siblings, 1 reply; 6+ messages in thread
From: peter karlsson @ 2000-04-11  7:28 UTC (permalink / raw)
  To: cygwin; +Cc: Larry Hall (RFK Partners, Inc)

Larry Hall:

> If you're using the Cygwin compiler (and not the Mingw one), you can't just
> list crtdll as a library.  You'll be mixing the MS C RT with the Cygwin one
> and that will surely crash.  If you use the Mingw compiler, you don't need
> to specify the C RT either, since you'll get one of the MS ones by default.

I am using CygWin B20. I wasn't aware that there was something like a "Mingw
compiler", since the only reference to Mingw that I have seen is the header
files and the mingw32 library included with CygWin B20...

> Since you're not trying to port a UNIX app, I'd suggest using Mingw so that
> you don't pull in the Cygwin DLL and the overhead that goes with it.  See
> Mumit Kahn's web pages for more information on the differences between the
> Cygwin compiler, the Mingw compiler, and how to build things with either/
> both.

Where can I get this Mingw?

> Alternatively, you can just use the Cygwin compiler and use _findfirst() 
> and _findnext() (or its Win32 equivalents) and add the appropriate prototype
> (if its not in the header files already).  Obviously, you can use Win32 calls
> directly....

As I said, there are prototypes in mingw32/dir.h, but the program refuses to
link if I call the functions prototyped there. If I grep for _findfirst, I
find it in the libmingw32 file, but it won't link even with that one.

And for using Win32 calls, from what I figured from the FAQ, I need to write
-mwindows to do that, and that will turn the program into a GUI application,
which I do not want...?

-- 
\\//
peter - http://www.softwolves.pp.se/



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Re: Porting OS/2 EMX __findfirst / __findnext
  2000-04-11  7:28 ` Porting OS/2 EMX __findfirst / __findnext peter karlsson
@ 2000-04-11 12:14   ` Larry Hall (RFK Partners, Inc)
  0 siblings, 0 replies; 6+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2000-04-11 12:14 UTC (permalink / raw)
  To: peter karlsson, cygwin@sourceware.cygnus.com

At 10:28 AM 4/11/00, peter karlsson wrote:
>Larry Hall:
>
> > If you're using the Cygwin compiler (and not the Mingw one), you can't just
> > list crtdll as a library.  You'll be mixing the MS C RT with the Cygwin one
> > and that will surely crash.  If you use the Mingw compiler, you don't need
> > to specify the C RT either, since you'll get one of the MS ones by default.
>
>I am using CygWin B20. I wasn't aware that there was something like a "Mingw
>compiler", since the only reference to Mingw that I have seen is the header
>files and the mingw32 library included with CygWin B20...


You need to look at Mumit Kahn's web pages to understand the differences
between Cygwin and Mingw.  They aren't the same thing and you can't mix and
match libraries and headers generally.  The short synopsis is, the Mingw 
version of the gcc compiler should be used for programs that want the native 
(MS) C runtime, without the overhead (and license "restrictions") of Cygwin. 
Cygwin should be used for programs that have POSIX semantics (probably those
that are ported from *NIX platforms).  


> > Since you're not trying to port a UNIX app, I'd suggest using Mingw so that
> > you don't pull in the Cygwin DLL and the overhead that goes with it.  See
> > Mumit Kahn's web pages for more information on the differences between the
> > Cygwin compiler, the Mingw compiler, and how to build things with either/
> > both.
>
>Where can I get this Mingw?


As I mentioned, check out Mumit Kahn's site.  Follow the pointer from the
Cygwin site.


> > Alternatively, you can just use the Cygwin compiler and use _findfirst() 
> > and _findnext() (or its Win32 equivalents) and add the appropriate prototype
> > (if its not in the header files already).  Obviously, you can use Win32 calls
> > directly....
>
>As I said, there are prototypes in mingw32/dir.h, but the program refuses to
>link if I call the functions prototyped there. If I grep for _findfirst, I
>find it in the libmingw32 file, but it won't link even with that one.
>
>And for using Win32 calls, from what I figured from the FAQ, I need to write
>-mwindows to do that, and that will turn the program into a GUI application,
>which I do not want...?


There's a way to get Win32 calls for console apps but I don't recall the 
correct switches...

Perhaps Tim Prince's response is the best one - why not just use autoconf
and avoid all the troubles/confusion of what environment to use, at least
at first?

Good luck,


Larry



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* RE: Porting OS/2 EMX __findfirst / __findnext
       [not found] <4.3.1.2.20000412132040.00d79790@pop.ma.ultranet.com>
@ 2000-04-13 13:40 ` peter karlsson
  0 siblings, 0 replies; 6+ messages in thread
From: peter karlsson @ 2000-04-13 13:40 UTC (permalink / raw)
  To: cygwin; +Cc: Larry Hall (RFK Partners, Inc)

Larry Hall (RFK Partners, Inc):

> If you really need getops(), you will need to write your own, find a
> substitute, or switch back to the Cygwin compiler and run configure.

I wrote a simple substitute to use when it isn't available. The rest of the
code seems to work fine now (including _findfirst), after patching limits.h
a little bit to get around some pre-processor errors I got using it.

> I'm not sure why findfirst()/findnext() would have disappeared from the
> Mingw version. Are you sure its not just in other files?

They are in io.h.


Thanks to everyone who answered! Seems to work just fine now (hopefully I
didn't break the CygWin compilation in the progress).

-- 
\\//
peter - http://www.softwolves.pp.se/



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* RE: Porting OS/2 EMX __findfirst / __findnext
       [not found] <65CAA822B707D211AD430008C7F40FED7489D4@EXCHANGERSW2>
@ 2000-04-12 10:09 ` peter karlsson
  0 siblings, 0 replies; 6+ messages in thread
From: peter karlsson @ 2000-04-12 10:09 UTC (permalink / raw)
  To: cygwin; +Cc: McCunney, Dennis

McCunney, Dennis:

> The Mingw setup uses the GNU compiler, but has a seperate configuration to
> use MS runtimes, libraries, and header files.  You must keep the Cygwin and
> Mingw environments carefully seperate.  You cannot blend features.

Then why is there a libmingw32.a and certian mingw32 header files included
in the Cygwin distributions?

> Go to Mumit Khan's site at 
> http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ 
> for information and the needed software.

Okay, downloaded and installed it, but ran into problems... It seems not to
have any getopt, so at the moment I cannot compile my program. And, I can't
seem to find findfirst/findnext, the include file that was in CygWin
(<mingw32/dir.h>) does not seem to be existant.

-- 
\\//
peter - http://www.softwolves.pp.se/


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Re: Porting OS/2 EMX __findfirst / __findnext
  2000-04-11  6:37 peter karlsson
@ 2000-04-11  7:30 ` Tim Prince
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Prince @ 2000-04-11  7:30 UTC (permalink / raw)
  To: peter karlsson, cygwin

autoconf doesn't need porting; it installs "out of the box."

----- Original Message -----
From: "peter karlsson" <peter@softwolves.pp.se>
To: <cygwin@sourceware.cygnus.com>
Sent: Tuesday, April 11, 2000 6:37 AM
Subject: Porting OS/2 EMX __findfirst / __findnext


> Hi!
>
> I have a program that is originally written for EMX, and it uses
> findfirst/findnext to read diretories. When I ported it to Linux, I used
> opendir/readdir, but since that requires extra overhead (with filtering
out
> the files I actually want), I want to use findfirst/findnext also under
> CygWin.
>
> I found prototypes for _findfirst and _findnext in mingw32/dir.h, but it
> doesn't compile with those, even when I try to include -lmingw32 to the
gcc
> command line. It *did* compile with -lcrtdll, but then the program crashes
> with an unhandled exception on startup.
>
> The program in question is a console-mode application.
>
>
> I am using a configure script to try to figure out what is available or
not,
> has anyone ported autconf to work with Cygwin?
>
>
> Also, is there any documentation that is downloadable (as opposed to the
> several-HTML-document things on the Cygnus website)?
>
>
> Please reply with a Cc to my address, since I have not decided whether to
> start to subscribe to this mailinglist yet...
>
> Thanks in advance!
> --
> \\//
> peter - http://www.softwolves.pp.se/
>
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
>



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

* Porting OS/2 EMX __findfirst / __findnext
@ 2000-04-11  6:37 peter karlsson
  2000-04-11  7:30 ` Tim Prince
  0 siblings, 1 reply; 6+ messages in thread
From: peter karlsson @ 2000-04-11  6:37 UTC (permalink / raw)
  To: cygwin

Hi!

I have a program that is originally written for EMX, and it uses
findfirst/findnext to read diretories. When I ported it to Linux, I used
opendir/readdir, but since that requires extra overhead (with filtering out
the files I actually want), I want to use findfirst/findnext also under
CygWin.

I found prototypes for _findfirst and _findnext in mingw32/dir.h, but it
doesn't compile with those, even when I try to include -lmingw32 to the gcc
command line. It *did* compile with -lcrtdll, but then the program crashes
with an unhandled exception on startup.

The program in question is a console-mode application.


I am using a configure script to try to figure out what is available or not,
has anyone ported autconf to work with Cygwin?


Also, is there any documentation that is downloadable (as opposed to the
several-HTML-document things on the Cygnus website)?


Please reply with a Cc to my address, since I have not decided whether to
start to subscribe to this mailinglist yet... 

Thanks in advance!
-- 
\\//
peter - http://www.softwolves.pp.se/


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

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

end of thread, other threads:[~2000-04-13 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4.3.1.2.20000411100456.00d7c9d0@pop.ma.ultranet.com>
2000-04-11  7:28 ` Porting OS/2 EMX __findfirst / __findnext peter karlsson
2000-04-11 12:14   ` Larry Hall (RFK Partners, Inc)
     [not found] <4.3.1.2.20000412132040.00d79790@pop.ma.ultranet.com>
2000-04-13 13:40 ` peter karlsson
     [not found] <65CAA822B707D211AD430008C7F40FED7489D4@EXCHANGERSW2>
2000-04-12 10:09 ` peter karlsson
2000-04-11  6:37 peter karlsson
2000-04-11  7:30 ` Tim Prince

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