- OpenJDK Cookbook
- Alex Kasko Stanislav Kobylyanskiy Alexey Mironchenko
- 535字
- 2025-04-04 21:12:25
Building 64-bit FreeType libraries for OpenJDK 6 on Windows
The FreeType build for Windows amd64 is similar to the i586 build but has a much more complex configuration. Contrary to the i586 version, the amd64 library can be built with freely available tools using Microsoft Visual Studio 2005 Express Edition with the Windows Server 2003 SP1 Platform SDK.
Getting ready
For this recipe, we need to have Windows 7 SP1 amd64 running.
How to do it...
The following steps will help us in building FreeType:
- Download the Visual Studio 2005 Express Edition from http://www.microsoft.com/en-in/default.aspx and install it to the default location. The messages about Windows 7 compatibility problems may be ignored.
- Install
VS80sp1-KB926748-X86-INTL
andVS80sp1-KB932232-X86-ENU
Visual Studio updates. - Download Windows Server 2003 SP1 Platform SDK from http://www.microsoft.com/en-in/default.aspx and install it using the default installation path. AMD-64 components are required for the build.
- Perform steps 2, 3, and 4 from the previous recipe to download and adjust FreeType sources.
- From the Start menu go to Microsoft Platform SDK for Windows Server 2003 SP1 | Open Build Environment Window | Windows Server 2003 64-bit Build Environment | Set Win Svr 2003 x64 Build Env (Retail).
- From the
cmd.exe
window that appears, run (the administrator permissions warning may be ignored):>"C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\IDE\VCExpress.exe"
- In the main menu navigate to Tools | Options | Projects and Solutions | VC++ Directories and adjust the following directories:
Executable files: C:\Program Files\Microsoft Platform SDK\Bin\win64\x86\AMD64 C:\Program Files\Microsoft Platform SDK\Bin C:\Windows\System32 Include files: C:\Program Files\Microsoft Platform SDK\Include C:\Program Files\Microsoft Platform SDK\Include\crt Library files: C:\Program Files\Microsoft Platform SDK\Lib\AMD64
- Open the FreeType solution at this path
freetype-2.5.2\builds\windows\vc2005\freetype.sln
. - In the menu, navigate to Project | Properties | Configuration Properties | Configuration Manager and choose <New ...> under Active solution platform.
- Type
new platform x64
and choose Win32 from Copy settings from. - On the Configuration Manager form, navigate to Active solution configuration | LIB Release Multithreaded and then go to Active solution platform | x64.
- On the same form, in the grid for the FreeType project, navigate to Configuration | Release multithreaded and leave the Win32 value under the Platform menu.
- In the Configuration Properties menu, check whether Configuration Type is set to Static Library (.lib).
- Navigate to Configuration Properties | C/C++ | Preprocessor and change the WIN32 value in the Processor Definitions string to WIN64.
- Run Build Solution under Build, the
freetype252MT.lib
library will be placed into thefreetype-2.5.2\objs\win32\vc2005
directory. Rename it tofreetype.lib
, and save it for later. - In the Configuration Properties menu, change Configuration Type to Dynamic Library (.dll) and choose Apply.
- Navigate to Configuration Properties | Linker | Input and put
bufferoverflowU.lib
into the Additional Dependencies field. - Navigate to Configuration Properties | Linker | Command Line and put
/MACHINE:AMD64
into the Additional options field. - Clean and build the solution. Target libraries
freetype.dll
andfreetype.exp
will be placed into thefreetype-2.5.2\objs\release_mt
directory.
The directory with three result files will be denoted by the ALT_FREETYPE_LIB_PATH
environment variable during OpenJDK builds.
How it works...
Visual Studio 2005 Express does not support amd64 architecture, so the setup to use amd64 compilers from Windows SDK takes most of this recipe.
See also
- The Building 32-bit FreeType libraries for OpenJDK 6 on Windows recipe
- The FreeType official website http://freetype.org/