This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: stand alone console app



On Wed, 3 Feb 1999, Dale P. Smith wrote:
> 
> 1. Can mingw32 create a static library. *Not* a dll!  I have a bit of
> code that needs to be linked with an application.  It cannot be in a dll. 
> (It's a looong story).  (Oh yeah, for linking with VC++ 4.0)

1.a) static library: sure.
  
  $ gcc -c foo1.c foo2.c
  $ ar crv libfoo.a foo1.o foo2.o

1.b) link directly with MSVC? Maybe, but before that you need to download
  the msvc40 runtime. Mingw as distributed uses CRTDLL runtime, but MSVC
  uses MSVCRT40.DLL. See my ftp area:
    ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/egcs-1.1.1/
  
  Even with this, there may be incompatibilities (one of them I know of
  __chkstk vs __chkstk). Feel free to experiment and let us know. You
  may need to name the archive, ie., static library, with .lib extension.

  $ ar crv foo.lib foo1.o foo2.o

> 2. Can mingw32 create .obj files that can be statically linked with VC++
> 4.0 .objs?

See above. Official answer is no (you can't even mix Microsoft's own
object files across some of the MSVC versions!).

The only recommended method is what you don't want to do -- use DLLs.
Anything else is unchartered and unsupported territory.

> 3. Can mingw32 create *any* kind of debug output that can be used with
> VC++ 4.0 Developer Studio?

No. Unless someone contributes the work, it's not going to happen.

> We use gcc here for solaris, sinix and sometimes sco, but VC++ for win32
> (95/nt). It
> would be so great to be able to build for any platform from out solaris
> development
> machines.  As it is, I have boot nt to compile (I usually rin Linux). 
> It's a real
> pain.

You can always cross compile from your Solaris or Intel directly for
either Cygwin or Mingw. I've posted the howto a few times to this list,
so a search should pull it up. May take a few tries, so have patience
while you're doing this the first time. Of course, this is with GCC;
you'll have to ask MS to get you a VC cross compiler (Good luck ;-).

Regards,
Mumit