Skip to content

Building the library

hasherezade edited this page Sep 29, 2022 · 17 revisions

LibPeConv uses CMake, so you need to have it installed on your machine.

With the help of CMake you can generate a project appropriate for your build environment. The recommended one is Visual Studio.


1. Clone the repository

With the help of Git run:

git clone https://github.com/hasherezade/libpeconv.git

2. Generate a project with CMake

Open CMake GUI

2.1 Set paths

  • "Where the source is" : set path to the cloned repository
  • "Where to build the binaries" : set where to save the generated Visual Studio project

2.2 Configure the build settings

  • Press "Configure"
  • "Specify the generator for the project": choose the Visual Studio version that is installed on your machine.
  • At this point you must also decide if you want to build 32 or 64 bit version of the library, and choose the appropriate option.
  • Press "Finish"
  • If you want to change the selected options, you need to configure the project again. But, to be able to do so, you need to first delete cache: File-> Delete cache

2.3 Choose project options

Now you can select the options specific to the project, i.e.

  • The directory where the project will be installed after build [step 1]
  • Whether or not to build testcases [step 2]
  • The charset with which the library is built: Multibyte (ANSI) or Unicode [step 3]

2.4 Generate the project

  • Press "Generate"
  • Finally, you can open the generated project in Visual Studio - manually or by clicking the button "Open Project"

3. Build and install

3.1 Build with Visual Studio

  • Build the project in Release mode:

  • If everything went fine, libpeconv.lib should be generated:

3.2 Install

  • Now you can install the library, along with the headers, to into the directory you previously selected (2.3 , step 1)

  • If the installation was successful, all the relevant elements should be copied

libpeconv.lib into {INSTALL_DIR}\lib:

libpeconv headers into into {INSTALL_DIR}\includes:

Now you can use the generated lib, along with the headers, to add libPEconv into your own project. More details described here.