make clean
in the notepad source directory if it contains results of previous builds. Create a separate directory with name notepad2, so it won't conflict with the Wine copy of the application. Copy the sources of notepad (*.c, *.h, and *.rc files) to this directory. Now run the commands mentioned above from the notepad2 directory:wnsprintfW
. This is because we didn't specify the libraries we need to link to. Normally you know which libraries you need or you can find a list in your old Makefile or project file.-i
:wine notepad2.exe.so
or ./notepad2.exe
.chmod -R u+w .
”. Also you will want to make sure that you have a backup copy of your sources in case something went horribly wrong, or more likely, just for reference at a later point. If you use a version control system you're already covered.--nosource-fix
option to protect them.--lower-uppercase
; --lower-all
--lower-uppercase
specifies they should only be renamed if their name is all uppercase. So files that have a mixed case, like Hello.c would not be renamed. --lower-all
will rename any file. If neither is specified then no file or directory will be renamed, almost. As you will see later, winemaker may still have to rename some files.--nobackup
--dll
; --console
--dll
. But if you have console executables then you will need to use the corresponding option.--mfc
-Dmacro=defn
; -Idir
; -Ldir
; -idll
; -llibrary
-i
specifies a Winelib library to import via the spec file mechanism. Contrast this with the -l
which specifies a Unix library to link with. The other options work the same way they would with a C compiler. All are applied to all the targets found. When specifying a directory with either -I
or -L
, winemaker will prefix a relative path with $(TOPDIRECTORY)/ so that it is valid from any of the source directories. You can also use a variable in the path yourself if you wish (but don't forget to escape the '$'). For instance you could specify -I$(WINELIB_INCLUDE_ROOT)/msvcrt
.diff -uw
. For instance: diff -uw hello.c.bak hello.c
-fshort-wchar
option to set the size of wchar_t
to the one expected by Windows applications.wcslen
, wsprintf
), then you must use the msvcrt runtime library instead of glibc. The functions in glibc will not work correctly with 16-bit strings.beginthread()
, loadlibrary()
, etc.fopen()
taking a Windows path rather than a Unix one.-mno-cygwin
to your compiler flags. This will cause winebuild to resolve your C library calls to msvcrt.dll.-luuid
to the link line.-fpic
flag to the compiler, which is the right thing to do for most target files, particularly DLLs. However, this option adds a good deal of overhead and isn't necessary for your 'main' executable. You can disable this for the main executable (and only do it for the main executable) by passing the -fno-pic -fno-PIC
compiler flags, either in the appropriate makefile rule or a direct compiler command.--cuiexe
and --dll
options.--nobackup
).--nolower-include
).-D
, -P
, -i
, -I
, -L
and -l
options if they are homogeneous enough between all your targets. Otherwise you may want to use winemaker interactive mode so that you can specify different settings for each project / target.STRICT
macro. Some programs will not compile if STRICT
is not turned on, and others will not compile if it is. Fortunately all the files in a given source tree use the same setting so that all you have to do is add -DSTRICT on winemaker command line or in the Makefile file(s).-P
, -i
, -L
and -l
options or adding these DLLs and libraries to the Makefile.SUBDIRS
is usually only present in the top-level makefile. For libraries and executables, specify the full name, including the .dll, .a or .exe extension. Note that these names must be in all lowercase.LIBRARIES
variable allows you to specify additional Unix libraries to link with. Note that you would normally not specify Winelib libraries there. To link with a Winelib library, one uses DLL_IMPORTS
. The exception is for C++ libraries where you currently don't have a choice but to link with them in the Unix sense. One library you are likely to find here is mfc.CEXTRA
, CXXEXTRA
and RCEXTRA
which allow you to specify additional flags for, respectively, the C compiler, the C++ compiler and the resource compiler. Finally note that all these variables contain the option's name.DLLS
field is where you would enumerate the list of DLLs that executable imports. It should contain the full DLL name, but not the -l
option.RC_INVOKED
is a macro name which is automatically defined by wrc.-I
directive to your wrc command so that it finds you system files. For instance you may add -I/usr/include -I/usr/lib/gcc-lib/i386-linux/2.95.2/include to cater to both C and C++ headers. But this supposes that you know where these header files reside which decreases the portability of your makefiles to other platforms.GetProcAddress
work. So it is necessary to duplicate these data structures in the Unix world to make these same APIs work with Winelib applications and libraries.wsprintf*
functions in user.spec and user32.spec for an example.--interactive
mode to specify the right options for the MFC and the ATL part (to get the include paths right, to not consider the MFC MFC-based, and to get it to build libraries, not executables).CMonikerFile
, OleDB
, HtmlView
, ...-isystem $(WINE_INCLUDE_ROOT)/msvcrt
), though it means you will have to temporarily disable winsock support (#ifdef it out in windows.h).man winebuild
).f
parameter does not have to be passed to the Linux function and the d
parameter (theoretically) has to be converted between unsigned long * and unsigned short *. Doing this ensures that the high bits of the returned value are set correctly. Also unlike with the ODBC example we will link directly to the Linux Shared Library.DllMain
the function is used to initialize the DLL. On the process attach event the function dynamically links to the desired Linux ODBC library (since there are several available) and builds a list of function pointers. It unlinks on the process detach event.--nosource-fix
(requires winemaker version 0.5.8 or later) to ensure that the two files are not modified (if using an older version, make the two files read-only and ignore the complaints about being unable to modify them).--dll --single-target MyWin --nomfc
to specify the target.--DMightNeedSomething -I3rd_party_include -L3rd_party_lib -lxxxx -lyyyy
where these are the locations of the header files etc.CEXTRA = -Wall
just before the defines.LD_LIBRARY_PATH
. If you can link to it from a Linux program it should be OK.WINEDLLPATH
includes the directory containing the proxy shared object.WINEDEBUG=+module
environment variable before running wine to see what is actually happening.wine_get_unix_file_name
(defined in winbase.h).