Skip to content

2.1. How to add PE sieve to your Visual Studio project

hasherezade edited this page Mar 7, 2024 · 13 revisions

Adding PE-sieve: DLL version

Once you built PE-sieve as a DLL, adding it to your existing Visual Studio project is easy.

  1. First you need to add paths for the headers and for the lib.
  • In Project->Properties->VC++ Directories: set two things:
    • Include Directories (to PEsieve headers)
    • Library Directories (to the directory where the pe-sieve.lib is)

added paths example

  1. Then you need to add pe-sieve.lib to the dependencies
  • In Project->Properties->Linker->Input: Additional Dependencies
    • add pe-sieve.lib

added lib example

  1. Once everything is added, you can include PE-sieve to your project using:
#include <pe_sieve_api.h>

using namespace pesieve;

Adding PE-sieve: static library version

To begin, you need to build PE-sieve as a static library. Use pe-sieve.lib, libpeconv.lib that were generated during this compilation.

PE-sieve is built as Multi-threaded (/MT), so the project that is going to use PE-sieve linked statically, must also be compiled in the same mode.

build multithreaded

  1. First you need to add paths for the headers and for the lib.
  • In Project->Properties->VC++ Directories: set two things:
    • Include Directories (to PEsieve headers)
    • Library Directories (to the directory where the pe-sieve.lib and libpeconv.lib is)

added paths example

  1. Then you need to add pe-sieve.lib, as well as libpeconv.lib to the dependencies
  • In Project->Properties->Linker->Input: Additional Dependencies
    • add pe-sieve.lib , libpeconv.lib, sig_finder.lib

added libs

  1. Once everything is added, you can include PE-sieve to your project using:
#define PESIEVE_STATIC_LIB
#include <pe_sieve_api.h>

using namespace pesieve;

It is important to add the macro-definition PESIEVE_STATIC_LIB before the header is included.

How to use API