Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Child Fund

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 78 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       winebuild [options] [input files]


       winebuild generates the C and assembly files that are nec­
       essary to build a Wine dll, which is basically a Win32 dll
       encapsulated inside a Unix library.

       winebuild  has  different modes, depending on what kind of
       file it is asked to generate. The mode is specified by one
       of  the  mode  options specified below. In addition to the
       mode option, various  other  command-line  option  can  be
       specified, as described in the OPTIONS section.


       You  have to specify exactly one of the following options,
       depending on what you want winebuild to generate.

       --spec= file.spec
              Build a C file from a spec file (see SPEC FILE SYN­
              TAX for details). The resulting C file must be com­
              piled and linked to the other object files to build
              a working Wine dll.
              In that mode, the input files should be the list of
              all object files that will be linked into the final
              dll,  to  allow  winebuild  to  get the list of all
              undefined symbols that need  to  be  imported  from
              other dlls.

       --exe= name
              Build  a  C  file for the named executable. This is
              basically the same as the --spec mode  except  that
              it  doesn't require a .spec file as input, since an
              executable doesn't export functions. The  resulting
              C  file  must  be  compiled and linked to the other
              object files to build a  working  Wine  executable,
              and  all  the  other object files must be listed as
              input files.

       --def= file.spec
              Build a .def file from a spec file.  This  is  used
              when building dlls with a PE (Win32) compiler.

              Build  a  C  file  containing  the  definitions for
              debugging channels. In that mode  the  input  files
              should  be  a  list  of C files to search for debug
              channel definitions. The resulting C file  must  be
              compiled and linked with the dll.

       --glue Build  a  C  file  containing the glue code for the
              16-bit calls contained in the input  files.   These


       -C, --source-dir=directory
              Change  to  the  specified directory before reading
              source     files.      Only      meaningful      in
              --debug and --glue modes.

       -D symbol
              Ignored for compatibility with the C compiler.

       -e, --entry=function
              Specify  the  module  entry  point function; if not
              specified, the default is  DllMain  for  dlls,  and
              main  or WinMain for CUI or GUI executables respec­
              tively. This is only valid for Win32 modules.

       -f flags
              Ignored for compatibility with the C compiler.

       -F, --filename=filename
              Set the file name of the module. The default is  to
              use  the  base  name  of the spec file (without any

       -h, --help
              Display a usage message and exit.

       -H, --heap=size
              Specify the size of the module local heap in  bytes
              (only valid for Win16 modules); default is no local

       -i, --ignore=[-]symbol[,[-]symbol]
              Specify a list of symbols that  should  be  ignored
              when   resolving   undefined  symbols  against  the
              imported libraries. This forces these symbols to be
              resolved  from  the Unix C library (or from another
              Unix library linked with  the  application).  If  a
              symbol  is  prefixed  by '-' it is removed from the
              list instead of  being  added;  a  stand-alone  '-'
              clears the whole list.

       -I directory
              Ignored for compatibility with the C compiler.

       -k, --kill-at
              Remove  the  stdcall  decorations  from  the symbol
              names in the generated .def file.  Only  meaningful
              in --def mode.

       -K flags
              Ignored for compatibility with the C compiler.

       -M, --main-module=module
              Specify that we are building  a  16-bit  dll,  that
              will  ultimately be linked together with the 32-bit
              dll specified in module.  Only meaningful in --spec

       -m, --exe-mode=mode
              Set  the  executable  mode, which can be one of the
              cui for a command line ASCII executable,
              gui for a graphical ASCII executable,
              cuiw for a command line Unicode executable,
              guiw for a graphical Unicode executable.
              A command line executable entry point is a normal C
              main function. A graphical executable has a WinMain
              entry point instead. The ASCII/Unicode  distinction
              applies to the strings that are passed to the entry
              This option is only meaningful in --exe mode.

       -N, --dll-name=dllname
              Set the internal name of the  module.  It  is  only
              used  in  Win16  modules. The default is to use the
              base name of the spec file (without any extension).
              This   is  used  for  KERNEL,  since  it  lives  in
              KRNL386.EXE. It shouldn't be needed otherwise.

       -o, --output=file
              Set the name of the output file (default  is  stan­
              dard output).

       -r, --res=rsrc.res
              Load  resources  from the specified binary resource
              file. The rsrc.res can be produced  from  a  source
              resource  file  with  wrc(1)  (or  with  a  Windows
              resource compiler).
              This option is only necessary  for  Win16  resource
              files,  the  Win32  ones can simply listed as input
              files and will automatically be  handled  correctly
              (though  the  -r  option  will  also work for Win32

              Display the program version and exit.

       -w, --warnings
              Turn on warnings.


   General syntax
       A spec file should contain a list of ordinal declarations.

       ordinal  specifies the ordinal number corresponding to the
       entry point,  or  '@'  for  automatic  ordinal  allocation
       (Win32 only).

       flags  is  a  series  of optional flags, preceded by a '-'
       character. The supported flags are:

                     The entry point is not  displayed  in  relay
                     debugging traces (Win32 only).

                     The  entry point will be imported by ordinal
                     instead of by name.

              -ret64 The function returns a 64-bit  value  (Win32

              -i386  The  entry  point  is only available on i386

                     The function uses CPU register to pass argu­

                     The  function  is  an interrupt handler rou­

                     The function cannot be imported  from  other
                     dlls,  it can only be accessed through GetP­

   Function ordinals
       ordinal  functype   [flags] exportname ( [args...] ) [han­

       This declaration defines a function entry point.  The pro­
       totype defined by exportname ( [args...] )  specifies  the
       name  available  for dynamic linking and the format of the
       arguments. '@' can be used instead of exportname for ordi­
       nal-only exports.

       functype should be one of:

                     for a normal Win32 function

              cdecl  for  a  Win32  function  using the C calling

              word   (16-bit unsigned value)

              s_word (16-bit signed word)

              long   (32-bit value)

              double (64-bit value)

              ptr    (linear pointer)

              str    (linear  pointer  to a null-terminated ASCII

              wstr   (linear pointer to a null-terminated Unicode

              segptr (segmented pointer)

              segstr (segmented   pointer  to  a  null-terminated
                     ASCII string).

              Only ptr, str, wstr, long and double are valid  for
                     Win32 functions.

       handler  is  the  name  of the actual C function that will
       implement that entry point in 32-bit mode. The handler can
       also  be  specified  as  dllname.function to define a for­
       warded function (one whose implementation  is  in  another
       dll).  If  handler  is  not specified, it is assumed to be
       identical to exportname.

       This first example defines an entry point for  the  32-bit
       GetFocus() call:

              @ stdcall GetFocus() GetFocus

       This  second example defines an entry point for the 16-bit
       CreateWindow() call (the ordinal 100 is just an  example);
       it  also  shows  how long lines can be split using a back­

              100 pascal CreateWindow(ptr ptr long s_word  s_word
              s_word \
                  s_word word word word ptr) WIN_CreateWindow

       To declare a function using a variable number of arguments
       in Win16, specify the function as taking no arguments. The
       arguments  are  then available with CURRENT_STACK16->args.
       In Win32, specify the function as varargs and  declare  it
       with  a  '...' parameter in the C file.  See the wsprintf*
       functions in user.exe.spec and user32.spec for an example.
       This declaration only works in Win16 spec files. In  Win32
       you should use extern instead (see below).

   Extern ordinals
       ordinal extern [flags] exportname [symbolname]

       This  declaration defines an entry that simply maps to a C
       symbol (variable or function). It only works in Win32 spec
       files.   exportname  will  point  to the symbol symbolname
       that must be defined in the C code. Alternatively, it  can
       be  of  the  form dllname.symbolname to define a forwarded
       symbol (one whose implementation is in  another  dll).  If
       symbolname is not specified, it is assumed to be identical
       to exportname.

   Stub ordinals
       ordinal stub [flags] exportname

       This declaration defines a stub  function.  It  makes  the
       name  and  ordinal available for dynamic linking, but will
       terminate execution with an error message if the  function
       is ever called.

   Equate ordinals
       ordinal equate [flags] exportname data

       This  declaration defines an ordinal as an absolute value.
       exportname will be the name available for dynamic linking.
       data  can be a decimal number or a hex number preceeded by


       Glue functions are used to call down to 16-bit code from a
       32-bit  function. This is done by declaring a special type
       of function prototype in the source  file  that  needs  to
       call  to  16-bit  code,  and  processing  the  source file
       through winebuild --glue.

       These prototypes must be of one of the following forms:

       extern WORD CALLBACK  prefix_CallTo16_word_xxx(  FARPROC16
       func, args );
       extern  LONG  CALLBACK prefix_CallTo16_long_xxx( FARPROC16
       func, args );

       The prefix can be anything you need to make  the  function
       names  unique inside a given dll. The xxx characters spec­
       ify the type of the arguments, with one  letter  for  each
       argument.  A  w indicates a WORD argument, a l indicates a
       winebuild  has  been  worked  on  by  many people over the
       years. The main authors are Robert J.  Amstadt,  Alexandre
       Julliard,  Martin  von  Loewis,  Ulrich  Weigand  and Eric
       Youngdale. Many other Wine  developers  have  contributed,
       please  check  the file Changelog in the Wine distribution
       for the complete details.


       It is not yet possible to use a PE-format dll in an import
       specification; only Wine dlls can be imported.

       If  you  find  a  bug,  please  submit  a  bug  report  at


       winebuild is part  of  the  wine  distribution,  which  is
       available  through  WineHQ, the wine development headquar­
       ters, at http://www.winehq.com/.


       wine(1), wrc(1).

Wine 20030813               March 2003               WINEBUILD(1)
Help us cut cost by not downloading the whole site!
Use of automated download sofware ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and therefore is expressedly prohibited. For more details on this, take a look here



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds