2014-11-16 47 views
1

無法在MingW上製作我不知道爲什麼它不起作用。通常這應該是很容易的部分,我試圖讓這個搞砸的東西工作幾天,它仍然沒有做任何事情。請幫助我,因爲我非常接近將這臺計算機通過窗戶投擲。由於無法識別選項

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

爲什麼使用Crypto ++ 5.0? – jww

回答

0

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'

這是從線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)開始)之前。您也可以在X86塊之後但在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 

停止使用加密+ 5.0,並使用加密的最新版本++(或者5.6.2 from the website,或者檢出的最新加密++從SVN)。

問題是依賴於參數的名稱查找。問題修復爲revision 522revision 539。直到最近(相對來說),GCC的後期版本(大約GCC 4.7左右)纔出現問題。

如果您查看Sourceforge上最新的secblock.h,那麼您將看到通過將語句更改爲this->CheckSize()(如GCC所建議的)已經解決了此特定問題。

如果您有一些未修復的straglers,請將this->添加到問題陳述中。例如,在上面的編譯問題中,您將打開secblock.h,向下滾動到第91行,然後將語句更改爲this->CheckSize()

+0

感謝您的回覆。我使用crypto50是因爲它位於列表的頂部,我沒有意識到它不是最新版本。我在使用教程時使用了最新版本。我也試過只是普通的化妝用新的版本,然後我得到這個: http://tny.cz/532530b1 現在我期運用libtomcrypt和它的作品,但我寧願使用cryptopp,因爲它有更多的文檔/支持/能力。它看起來不那麼複雜。 對不起noob thingys,但我剛開始c/c + +,我是我自己的老師 – DedicatedDreamer

+0

@DedicatedDreamer - 你有什麼問題,上面的答案沒有解決?如果它與上面的問題完全不同,那麼你應該問另一個問題(Stack Overflow是如何工作的)。 – jww