-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompiling_libs_on_windows.txt
109 lines (86 loc) · 3.95 KB
/
compiling_libs_on_windows.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Microsoft Visual Studio .lib compilaton
---------------------------------------
Important notice
================
Each .lib must be compiled with Multi-threaded (/MT) switch (project properties - configuration properties - c/c++ - code generation - runtime library)
Required software
=================
* Visual Studio / www.microsoft.com
* CMake / www.cmake.org
zlib + libpng / www.zlib.net www.libpng.org
=============
1) Extract zlib sources to <somewhere>/zlib/ (*)
2) Extract libpng sources to <somewhere/libpng/ (*)
3) Open <somewhere>/libpng/projects/visualc71/libpng.sln in MSVS
4) Select "LIB release"
5) Add gzlib.c gzclose.c gzread.c gzwrite.c to "zlib" project (**)
6) Remove gzio.c from "zlib" project (**)
7) Compile zlib and libpng
* These dirs must be on same level
** Required if you use zlib version >= 1.2.4 (hope it will be fixed in next zlib/libpng release)
*mingw* really rename extracted lib dirs from "zlib.1.2.3" to "zlib"
minizip / www.zlib.net
=======
1) Create an empty project
2) Add *.c (except miniunz.c and minizip.c) from <somewhere>/zlib/contrib/minizip/
3) Specify additional libraries directory as <somewhere>/zlib/
4) Same with additional includes directory
5) Compile it as static library
*mingw* minizip: add iowin32.c manually into the Makefile
*mingw* ar rcs minizip.a ioapi.o iowin32.o unzip.o zip.o
ircclient / sourceforge.net/projects/libircclient/
=========
1) Open Visual Studio 2008 Command Prompt
2) Navigate to libircclient source directory and execute following commands:
cl /nologo /W3 /O2 /I "../include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "ENABLE_THREADS" /FD /c libircclient.c
link /lib /nologo libircclient.obj
*mingw* rename libircclient-static.lib to .a
*mingw* modify makefile, fix compiler binary name (e.g. from i586-mingw-gcc.exe to mingw-gcc.exe)
jpeg (v8) / www.ijg.org
=========
1) Open Visual Studio 2008 Command Prompt
2) Navigate to libjpeg source directory and execute following commands:
copy jconfig.vc jconfig.h
nmake nodebug=1 /f makefile.vc clean libjpeg.lib
*mingw* do not download windows package, download unix package instead (yeah)
expat / sourceforge.net/projects/expat/
=====
1) Open <somewhere>/libexpat/lib/expat_static.sln
2) Compile it.
pcre / www.pcre.org
====
1) Extract sources to <somewhere>/libpcre/
2) Read "BUILDING PCRE ON WINDOWS WITH CMAKE" chapter of <somewhere>/libpcre/NON-UNIX-USE file
3) Open generated PCRE.sln and compile "pcre" project
tcl / www.tcl.tk
===
1) Open Visual Studio 2008 Command Prompt
2) Navigate to <tcl source directory>/win/ and execute following command: (*)
nmake /f makefile.vc core OPTS=static,threads
* To generate smaller .lib comment out lines with "OPTIMIZATIONS = $(OPTIMIZATIONS) -GL" string in rules.vc
*mingw* ./configure --disable-shared
glew / sourceforge.net/projects/glew/
====
1) Open <somewhere>/glew/build/vc6/glew.dsw
2) Compile glew_static project
directx / msdn.microsoft.com/en-us/directx/default.aspx
=======
1) Install DirectX SDK
2) Get a copy of dinput8.lib, dsound.lib, and dxguid.lib from "C:/Program Files/Microsoft DirectX SDK <Month Year>/Lib/<arch>/ directory.
*mingw* -ldinput -ldsound -ldxguid
cURL http://curl.haxx.se/libcurl/
====
0) extract .zip with sources, open vc6curl.dsw with MS VS, confirm project update
1) Make sure that: CURL_STATICLIB is defined as preprocessor definition,
2) HTTP_ONLY is defined as preprocessor definition,
3) "Configuration type" says "Static library (.lib)",
4) "Code generation" -> "Run-time library" is set to "Multi-threaded (Debug for debug version)",
5) Librarian -> "Ignore all default libraries" is "Yes",
6) compile as "using libcurl LIB Release",
7) your lib is in curl/lib/LIB-Release/libcurl.lib
*mingw* follow instructions from compiling_libs_on_unix, curl
Missing info
============
mgllt
Size reduction: same as when compiling on unix
strip --strip-unneeded --remove-section=.comment *.a