gpt4 book ai didi

compiler-errors - 由于无法识别的选项,无法在 MingW 上制作

转载 作者:行者123 更新时间:2023-12-02 10:48:26 33 4
gpt4 key购买 nike

我不知道为什么它不起作用..通常这应该是容易的部分,我试图让这个该死的东西工作好几天,但它仍然没有做任何事情。请帮助我,因为我非常接近将这台计算机扔出 window 。

> 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.

最佳答案

I'm trying to get this fucked up thing to work for days and it still doesn't do anything...



看起来你有两个问题。

g++: error: unrecognized command line option '-mbnu210'



这是来自 GNUMakefile 的第 72 行:
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

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

要记住的另一件事: 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

停止使用 Crypto++ 5.0,并使用最新版本的 Crypto++( 5.6.2 from the website 或从 SVN checkout 最新的 Crypto++)。

问题是依赖于参数的名称查找。问题已修复在 revision 522revision 539 .直到最近(相对而言),随着 GCC 的更高版本(大约 GCC 4.7 左右),这个问题才显现出来。

如果您查看最新的 secblock.h在 Sourceforge 上,您将看到已通过将语句更改为 this->CheckSize() 来解决此特定问题正如 GCC 所建议的那样。

如果您有一些未修复的流浪者,请添加 this->到问题陈述。例如,在上面的编译问题中,你会打开 secblock.h ,向下滚动到第 91 行,然后将语句更改为 this->CheckSize() .

关于compiler-errors - 由于无法识别的选项,无法在 MingW 上制作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26963303/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com