VisualC++で静的ライブラリとしてBotanをコンパイルすることに非常に失敗しました。build.hファイルには、次のコードが含まれています。
#ifndef BOTAN_DLL
#define BOTAN_DLL __declspec(dllexport)
#endif
このマクロは、次のように、Botanコードベースのほぼすべての場所に表示されます。
class BOTAN_DLL AutoSeeded_RNG : public RandomNumberGenerator
前の質問からの私の理解は、あなたがする必要があるのは値なしでBOTAN_DLLを定義することだけであり、それは静的ライブラリとしてうまくコンパイルされるべきであるということです。ただし、そうすると、「タグ名がありません」などのビルドエラーの膨大なリストが発生します。誰もがこれを行う方法を知っていますか?
編集:これは、makefileに/D"BOTAN_DLL"を追加した結果として生じるエラーのサンプルです。
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