无法使MingW平台上,由于不能识别的选项(Unable to make on MingW due

2019-10-21 06:54发布

我不知道为什么它不工作..通常这应该是比较容易的部分,我试图让这个搞砸了事情的日工作,它仍然没有做任何事情。 请帮助我,因为我非常接近透过窗户扔在这台计算机。

> C:\...\Downloads\crypto50>mingw32-make -f 

> GNUmakefile process_begin:
> CreateProcess(NULL, uname, ...) failed. process_begin:
> CreateProcess(NULL, uname, ...) failed. process_begin:
> CreateProcess(NULL, uname, ...) failed. g++ -g -mbnu210 -c md5.cpp
> g++: error: unrecognized command line option '-mbnu210'
> GNUmakefile:58: recipe for target 'md5.o' failed mingw32-make: ***
> [md5.o] Error 1

当我尝试按照这个家伙的教程https://sites.google.com/site/ievgensychov/cryptopp这是发生了什么:

> g++ -DNDEBUG -g -O2 -c shacal2.cpp g++ -DNDEBUG -g -O2 -c seed.cpp g++
> -DNDEBUG -g -O2 -c shark.cpp In file included from shark.h:9:0,
>                  from shark.cpp:4: secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::p ointer
> CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = unsigned char; boo l
> T_Align16 = false; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::pointer = uns igned char*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned
> int]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = unsigned
> char; A = CryptoPP::AllocatorWith Cleanup<unsigned char>;
> CryptoPP::SecBlock<T, A>::size_type = unsigned int]' algparam.h:17:2: 
> required from here secblock.h:91:14: error: 'CheckSize' was not
> declared in this scope, and no decl arations were found by
> argument-dependent lookup at the point of instantiation [
> -fpermissive]    CheckSize(n);
>               ^ secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< unsigned char>' are not found by unqualified
> lookup secblock.h:91:14: note: use 'this->CheckSize' instead
> secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::p ointer CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = unsigned char; boo l
> T_Align16 = true; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::pointer = unsi gned char*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned i
> nt]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = unsigned
> char; A = CryptoPP::AllocatorWith Cleanup<unsigned char, true>;
> CryptoPP::SecBlock<T, A>::size_type = unsigned int ]' modes.h:63:34:  
> required from here secblock.h:91:14: error: 'CheckSize' was not
> declared in this scope, and no decl arations were found by
> argument-dependent lookup at the point of instantiation [
> -fpermissive] secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< unsigned char>' are not found by unqualified
> lookup secblock.h:91:14: note: use 'this->CheckSize' instead
> secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::p ointer CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = long long unsigned  int;
> bool T_Align16 = false; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::poin ter = long long unsigned int*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::siz e_type = unsigned
> int]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = long long
> unsigned int; A = CryptoPP::Allo catorWithCleanup<long long unsigned
> int>; CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
> shark.h:22:27:   required from 'CryptoPP::BlockCipherFinal<DIR,
> BASE>::BlockCiph erFinal() [with CryptoPP::CipherDir DIR =
> (CryptoPP::CipherDir)0u; BASE = Crypto PP::SHARK::Enc]'
> shark.cpp:43:20:   required from here secblock.h:91:14: error:
> 'CheckSize' was not declared in this scope, and no decl arations were
> found by argument-dependent lookup at the point of instantiation [
> -fpermissive] secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< long long unsigned int>' are not found by
> unqualified lookup secblock.h:91:14: note: use 'this->CheckSize'
> instead GNUmakefile:73: recipe for target 'shark.o' failed
> mingw32-make: *** [shark.o] Error 1
> 
> c:\cryptopp>mingw32-make test g++ -DNDEBUG -g -O2 -c shark.cpp In file
> included from shark.h:9:0,
>                  from shark.cpp:4: secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::p ointer
> CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = unsigned char; boo l
> T_Align16 = false; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::pointer = uns igned char*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned
> int]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = unsigned
> char; A = CryptoPP::AllocatorWith Cleanup<unsigned char>;
> CryptoPP::SecBlock<T, A>::size_type = unsigned int]' algparam.h:17:2: 
> required from here secblock.h:91:14: error: 'CheckSize' was not
> declared in this scope, and no decl arations were found by
> argument-dependent lookup at the point of instantiation [
> -fpermissive]    CheckSize(n);
>               ^ secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< unsigned char>' are not found by unqualified
> lookup secblock.h:91:14: note: use 'this->CheckSize' instead
> secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::p ointer CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = unsigned char; boo l
> T_Align16 = true; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::pointer = unsi gned char*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned i
> nt]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = unsigned
> char; A = CryptoPP::AllocatorWith Cleanup<unsigned char, true>;
> CryptoPP::SecBlock<T, A>::size_type = unsigned int ]' modes.h:63:34:  
> required from here secblock.h:91:14: error: 'CheckSize' was not
> declared in this scope, and no decl arations were found by
> argument-dependent lookup at the point of instantiation [
> -fpermissive] secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< unsigned char>' are not found by unqualified
> lookup secblock.h:91:14: note: use 'this->CheckSize' instead
> secblock.h: In instantiation of 'CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::p ointer CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = long long unsigned  int;
> bool T_Align16 = false; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::poin ter = long long unsigned int*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::siz e_type = unsigned
> int]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = long long
> unsigned int; A = CryptoPP::Allo catorWithCleanup<long long unsigned
> int>; CryptoPP::SecBlock<T, A>::size_type = unsigned int]'
> shark.h:22:27:   required from 'CryptoPP::BlockCipherFinal<DIR,
> BASE>::BlockCiph erFinal() [with CryptoPP::CipherDir DIR =
> (CryptoPP::CipherDir)0u; BASE = Crypto PP::SHARK::Enc]'
> shark.cpp:43:20:   required from here secblock.h:91:14: error:
> 'CheckSize' was not declared in this scope, and no decl arations were
> found by argument-dependent lookup at the point of instantiation [
> -fpermissive] secblock.h:91:14: note: declarations in dependent base 'CryptoPP::AllocatorBase< long long unsigned int>' are not found by
> unqualified lookup secblock.h:91:14: note: use 'this->CheckSize'
> instead GNUmakefile:73: recipe for target 'shark.o' failed
> mingw32-make: *** [shark.o] Error 1
> 
> c:\cryptopp>mkdir include\cryptopp
> 
> c:\cryptopp>mkdir lib
> 
> c:\cryptopp>copy *.h include\cryptopp 3way.h adler32.h aes.h algebra.h
> algparam.h arc4.h argnames.h asn.h authenc.h base32.h base64.h
> basecode.h bench.h blowfish.h blumshub.h camellia.h cast.h cbcmac.h
> ccm.h channels.h cmac.h config.h cpu.h crc.h cryptlib.h default.h
> des.h dh.h dh2.h dll.h dmac.h dsa.h eax.h ec2n.h eccrypto.h ecp.h
> elgamal.h emsa2.h eprecomp.h esign.h factory.h files.h filters.h
> fips140.h fltrimpl.h gcm.h gf256.h gf2n.h gf2_32.h gfpcrypt.h gost.h
> gzip.h hex.h hmac.h hrtimer.h ida.h idea.h integer.h iterhash.h
> lubyrack.h luc.h mars.h md2.h md4.h md5.h mdc.h misc.h modarith.h
> modes.h modexppc.h mqueue.h mqv.h nbtheory.h network.h nr.h oaep.h
> oids.h osrng.h panama.h pch.h pkcspad.h polynomi.h pssr.h pubkey.h
> pwdbased.h queue.h rabin.h randpool.h rc2.h rc5.h rc6.h resource.h
> rijndael.h ripemd.h rng.h rsa.h rw.h safer.h salsa.h seal.h secblock.h
> seckey.h seed.h serpent.h serpentp.h sha.h shacal2.h shark.h simple.h
> skipjack.h smartptr.h socketft.h sosemanuk.h square.h stdcpp.h
> strciphr.h tea.h tiger.h trdlocal.h trunhash.h ttmac.h twofish.h
> validate.h vmac.h wait.h wake.h whrlpool.h winpipes.h words.h xtr.h
> xtrcrypt.h zdeflate.h zinflate.h zlib.h
>       134 file(s) copied.
> 
> c:\cryptopp>copy *.a lib
> *.a Het systeem kan het opgegeven bestand niet vinden.
>         0 file(s) copied.

Answer 1:

我试图让这个搞砸了事情的日工作,它仍然没有做任何事情...

它看起来像你有两个问题。


克++:错误:无法识别的命令行选项“-mbnu210”

这是从72行GNUMakefile :

ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist
CXXFLAGS += -mbnu210
else
CXXFLAGS += -pipe
endif

这听起来像没有设置你的MinGW正确。 更具体地讲,无论是(1) mingw-developer-tools未安装(通过mingw-get ),或(2)你的路径是不完全正确,缺乏C:\MinGW\msys\1.0\bin路径(这就是uname住)。

你可以尝试一些像DJGPP测试之前以下。 打开GNUMakefile ,并添加测试和分配。

ifeq ($(IS_MINGW),1)
UNAME=mingw
endif

我会在大约28行添加它,在测试之前X86(即行29开头ifeq ($(ISX86),1) 你也可以在71行左右的X86块之后,但在DJGPP测试之前添加。

还有一两件事要记住: IS_MINGW设置上线17以下:

IS_MINGW = $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -c "mingw")

如果 IS_MINGW设置正确,那么你可能想将其设置为1无条件。


> g++ -DNDEBUG -g -O2 -c shacal2.cpp g++ -DNDEBUG -g -O2 -c seed.cpp g++
> -DNDEBUG -g -O2 -c shark.cpp In file included from shark.h:9:0,
>                  from shark.cpp:4: secblock.h: In instantiation of 
> 'CryptoPP::AllocatorWithCleanup<T, T_Align16>::p ointer
> CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::allocate(CryptoPP::Allocato rWithCleanup<T,
> T_Align16>::size_type, const void*) [with T = unsigned char; boo l
> T_Align16 = false; CryptoPP::AllocatorWithCleanup<T,
> T_Align16>::pointer = uns igned char*;
> CryptoPP::AllocatorWithCleanup<T, T_Align16>::size_type = unsigned
> int]': secblock.h:247:25:   required from 'CryptoPP::SecBlock<T,
> A>::SecBlock(CryptoPP: :SecBlock<T, A>::size_type) [with T = unsigned
> char; A = CryptoPP::AllocatorWith Cleanup<unsigned char>;
> CryptoPP::SecBlock<T, A>::size_type = unsigned int]' algparam.h:17:2: 
> required from here secblock.h:91:14: error: 'CheckSize' was not
> declared in this scope, and no decl arations were found by
> argument-dependent lookup at the point of instantiation [
> -fpermissive]    CheckSize(n);
>               ^ secblock.h:91:14: note: declarations in dependent base 
> 'CryptoPP::AllocatorBase< unsigned char>' are not found by unqualified
> lookup secblock.h:91:14: note: use 'this->CheckSize' instead

停止使用加密+ 5.0,并使用最新版本的加密+的(或者5.6.2从网站 ,或从Google Checkout的最新加密+ SVN )。

问题是争论从属名称查找。 这个问题被固定在修订522和修改539 。 这个问题并没有表现出它的头,直到最近(相对而言),与后来的版本的GCC(海湾合作委员会大约4.7左右)。

如果您检查最新secblock.h Sourceforge上,然后你会看到在这个问题上已经改变语句来固定this->CheckSize()由GCC建议。

如果你有一些straglers那些没有固定,再加入this->问题的陈述。 例如,在上面的编译问题,你会打开secblock.h ,向下滚动到91行,然后更改该声明this->CheckSize()



文章来源: Unable to make on MingW due to unrecognized option