4. Programming with Cygwin. Comtrol DeviceMaster Software Development Kit
Reklama
Reklama
Chapter 4. Programming with Cygwin
4.1. Using GCC with Cygwin
4.1.1. Console Mode Applications
Use gcc to compile, just like under UNIX. Refer to the GCC User’s Guide for information on standard usage and options. Here’s a simple example:
Example 4-1. Building Hello World with GCC
C:\cygnus\>
C:\cygnus\> gcc hello.c -o hello.exe
hello.exe
Hello, World
C:\cygnus\>
4.1.2. GUI Mode Applications
Cygwin allows you to build programs with full access to the standard Windows 32-bit
API, including the GUI functions as defined in any Microsoft or off-the-shelf publication. However, the process of building those applications is slightly different, as you’ll be using the GNU tools instead of the Microsoft tools.
For the most part, your sources won’t need to change at all. However, you should remove all __export attributes from functions and replace them like this: int foo (int) __attribute__ ((__dllexport__)); int foo (int i)
63
Preuzimanje
Reklama