This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: COM


Thanks

There are things known and things Unknown.
In between are the doors - Jim Morrison

> ----------
> From: 	Robert Praetorius[SMTP:RPraetorius at AspenRes dot Com]
> Reply To: 	RPraetorius at AspenRes dot Com
> Sent: 	Wednesday, March 05, 2003 10:00 PM
> To: 	Manu Anand
> Subject: 	RE: COM
> 
> > I don't have web access here.
> > Thanks for your help.
> > I'll try it and let you know.
> > -Manu
> 
>      I'm not sure precisely what you mean by not having "web access here".
> 
> In case you don't have access to it, I'm including the section of the 
> Cygwin FAQ that I referred to (along with the next few sections, which are
> 
> somewhat related).
> 
> ----------------------------------------------------------------------
> 
> 
> How do I use Win32 API calls?
> 
> (Please note: This section has not yet been updated for the latest net
> release.)
> 
> It's pretty simple actually. Cygwin tools require that you explicitly link
> the import libraries for whatever Win32 API functions that you are going
> to use, with the exception of kernel32, which is linked automatically
> (because the startup and/or built-in code uses it).
> 
> For example, to use graphics functions (GDI) you must link with gdi32 like
> this:
> 
> gcc -o foo.exe foo.o bar.o -lgdi32
> 
> or (compiling and linking in one step):
> 
> gcc -o foo.exe foo.c bar.c -lgdi32
> 
> The following libraries are available for use in this way:
> 
> advapi32 largeint ole32 scrnsave vfw32 cap lz32 oleaut32 shell32 win32spl
> comctl32 mapi32 oledlg snmp winmm comdlg32 mfcuia32 olepro32 svrapi
> winserve ctl3d32 mgmtapi opengl32 tapi32 winspool dlcapi mpr penwin32 th32
> winstrm gdi32 msacm32 pkpd32 thunk32 wow32 glaux nddeapi rasapi32 url
> wsock32 
> glu32 netapi32 rpcdce4 user32 wst icmp odbc32 rpcndr uuid imm32 odbccp32
> rpcns4 vdmdbg kernel32 oldnames rpcrt4 version
> 
> The regular setup allows you to use the option -mwindows on the command
> line to include a set of the basic libraries (and also make your program a
> GUI program instead of a console program), including user32, gdi32 and,
> IIRC, comdlg32.
> 
> Note that you should never include -lkernel32 on your link line unless you
> are invoking ld directly. Do not include the same import library twice on
> your link line. Finally, it is a good idea to put import libraries last on
> your link line, or at least after all the object files and static 
> libraries that reference them.
> 
> The first two are related to problems the linker has (as of b18 at least)
> when import libraries are referenced twice. Tables get messed up and
> programs crash randomly. The last point has to do with the fact that gcc
> processes the files listed on the command line in sequence and will only
> resolve 
> references to libraries if they are given after the file that makes the
> reference.
> How do I compile a Win32 executable that doesn't use Cygwin?
> 
> The -mno-cygwin flag to gcc makes gcc link against standard Microsoft DLLs
> instead of Cygwin. This is desirable for native Windows programs that
> don't need a UNIX emulation layer.
> 
> This is not to be confused with 'MinGW' (Minimalist GNU for Windows),
> which is a completely separate effort. That project's home page is
> http://www.mingw.org/index.shtml.
> 
> 
> 
> Can I build a Cygwin program that does not require cygwin1.dll at runtime?
> 
> No. If your program uses the Cygwin API, then your executable cannot run
> without cygwin1.dll. In particular, it is not possible to statically link
> with a Cygwin library to obtain an independent, self-contained executable.
> 
> If this is an issue because you intend to distribute your Cygwin
> application, then you had better read and understand
> http://cygwin.com/licensing.html, which explains the licensing options.
> Unless you purchase a special commercial license from Red Hat, then your
> Cygwin application must be Open 
> Source.
> 
> 
> 
> Can I link with both MSVCRT*.DLL and cygwin1.dll?
> 
> No, you must use one or the other, they are mutually exclusive.
> 
> 
> 
> How do I make the console window go away?
> 
> The default during compilation is to produce a console application. It you
> are writing a GUI program, you should either compile with -mwindows as
> explained above, or add the string "-Wl,--subsystem,windows" to the GCC
> commandline.
> 
> 
> 
DISCLAIMER: Information contained and transmitted by this E-MAIL is
proprietary to Mascot Systems Limited and is intended for use only by the
individual or entity to which it is addressed, and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If this is a forwarded message, the content of this E-MAIL may not have
been sent with the authority of the Company. If you are not the intended
recipient, an agent of the intended recipient or a person responsible for
delivering the information to the named recipient, you are notified that any
use, distribution, transmission, printing, copying or dissemination of this
information in any way or in any manner is strictly prohibited. If you have
received this communication in error, please delete this mail & notify us
immediately at Mailadmin at mascotsystems dot com Before opening attachments,
please scan for viruses. 



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]