How to compile Botan crypton library as a static library in VC ++?

I was extremely unsuccessful at compiling Botan as a static library in Visual C ++. The build.h file contains the following code:

#ifndef BOTAN_DLL
  #define BOTAN_DLL __declspec(dllexport)
#endif

This macro appears almost everywhere in the botanical code base, for example:

class BOTAN_DLL AutoSeeded_RNG : public RandomNumberGenerator

My understanding from the previous question is that all you have to do is define BOTAN_DLL without a value, and it should compile as a static library. However, this leads to a huge list of build errors, such as "missing tag name". Does anyone know how to do this?

EDIT . The following is an example of errors that result from adding / D "BOTAN_DLL" to the makefile:

        cl.exe /Ibuild\include /O2  /EHsc /GR /D_CONSOLE /D "BOTAN_DLL"  /nologo
 /c src\checksum\adler32\adler32.cpp /Fobuild\lib\adler32.obj
adler32.cpp
build\include\botan/allocate.h(19) : error C2332: 'class' : missing tag name
build\include\botan/allocate.h(19) : error C2143: syntax error : missing ';' bef
ore 'constant'
build\include\botan/allocate.h(19) : error C2059: syntax error : 'constant'
build\include\botan/allocate.h(20) : error C2143: syntax error : missing ';' bef
ore '{'
build\include\botan/allocate.h(20) : error C2447: '{' : missing function header
(old-style formal list?)
build\include\botan/secmem.h(229) : error C2143: syntax error : missing ';' befo
re '*'
        build\include\botan/secmem.h(230) : see reference to class template inst
antiation 'Botan::MemoryRegion<T>' being compiled
build\include\botan/secmem.h(229) : error C4430: missing type specifier - int as
sumed. Note: C++ does not support default-int
+3
3

, ? , ?

, :

cl.exe /Ibuild\include /O2  /EHsc /GR /D_CONSOLE /D "BOTAN_DLL"  /nologo
 /c src\checksum\adler32\adler32.cpp /Fobuild\lib\adler32.obj

, /D , . :

cl.exe /Ibuild\include /O2  /EHsc /GR /D_CONSOLE /DBOTAN_DLL=  /nologo
 /c src\checksum\adler32\adler32.cpp /Fobuild\lib\adler32.obj

EDIT: /DBOTAN_DLL, /DBOTAN_DLL=1, /DBOTAN_DLL=, . /DBOTAN_DLL 1, :

class 1 Allocator { ...
0

Botan, , , . , "" - .

configure.py --disable-shared

make botan.lib DLL. build.h,

#ifndef BOTAN_DLL
  #define BOTAN_DLL 
#endif
+4

__ declspec (dllexport) . , . , Static Library (lib)

| |

. , dll .

0

Source: https://habr.com/ru/post/1710463/


All Articles