[cryptopp-users] Re: this simple sample does not compile

2018-05-14 Thread anteus4
ok It works. now. 
Thank you.


2018. május 14., hétfő 20:40:06 UTC+2 időpontban Jeffrey Walton a 
következőt írta:
>
>
>
> On Monday, May 14, 2018 at 8:42:30 AM UTC-4, ant...@gmail.com wrote:
>>
>>
>>
>> 2018. május 14., hétfő 14:35:22 UTC+2 időpontban Jeffrey Walton a 
>> következőt írta:
>>>
>>>
>>>
>>> On Monday, May 14, 2018 at 2:28:06 AM UTC-4, ant...@gmail.com wrote:

 I cannot use your library without compilation errors when using mingw. 
 I am compiling this sample sample

 #include "sha.h"
 #include "filters.h"
 #include "base64.h"

 std::string SHA256HashString(std::string aString){
 std::string digest;
 CryptoPP::SHA256 hash;

 /*CryptoPP::StringSource foo(aString, true,
 new CryptoPP::HashFilter(hash,
   new CryptoPP::Base64Encoder (
  new CryptoPP::StringSink(digest;*/

 return digest;
 }

 I compiled the library before in msys.

>>>
>>> Ideally the library and your program are built with the same CXXFLAGS. 
>>> What are the CXXFLAGS used by the GNUmakefile when building in your setup? 
>>> Can you show the compiler invocation for cryptlib.cpp?
>>>
>>> For example, on Linux it looks like:
>>>
>>> $ make cryptlib.o
>>> g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>>>
>>> Or:
>>>
>>> $ CXX=clang++ make cryptlib.o
>>> clang++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>>>
>>> Uri and Marcel, do you have any experience with this setup?
>>>
>>> Jeff
>>>
>>
>> I tried to make them the same.
>>
>> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
>> -mconsole -pipe -c hex.cpp
>> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
>> -mconsole -pipe -c hmac.cpp
>> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
>> -mconsole -pipe -c hrtimer.cpp
>>
>> and compiling the example
>> Error executing D:\upp-mingw-11873\upp\bin/mingw64/32/bin\c++.exe -static 
>> -mwindows -mthreads -mconsole -o 
>> "D:\upp-mingw-11873\upp\out\MyApps\MINGW.\crypto
>> pp_test.exe" 
>> -Wl,-Map,"D:\upp-mingw-11873\upp\out\MyApps\MINGW.\cryptopp_test.map" 
>> -Wl,-s -L"D:\upp-mingw-11873\upp\bin/mingw64/32/i686-w64-mingw32/lib
>> " -L"D:\upp-mingw-11873\upp\bin/mingw64/32/opt/lib" -Wl,-O,2 
>> -L"d:/libs/cryptopp"  
>> "D:/upp-mingw-11873/upp/out/MyApps/cryptopp_test/MINGW.Main\cryptopp
>> _test.o" -Wl,--start-group  
>> "D:/upp-mingw-11873/upp/out/MyApps/Core/MINGW.\Core.a" 
>> "D:/upp-mingw-11873/upp/out/MyApps/plugin/z/MINGW.\z.a" -ladvapi32 -
>> lshell32 -lwinmm -lmpr -lole32 -loleaut32 -luuid -lws2_32 -lcryptopp 
>> -Wl,--end-group
>>
>> can you see a significant difference?
>>
>
> I see two differences. First, you are using g++ to build the library and 
> mingw64/32/bin\c++.exe to build the program. Second, -m64 is present in the 
> library build but not the program.
>
> You need to use the same compiler and mostly the same CXXFLAGS to build 
> things.
>
> Jeff
>

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[cryptopp-users] Re: this simple sample does not compile

2018-05-14 Thread Jeffrey Walton


On Monday, May 14, 2018 at 8:42:30 AM UTC-4, ant...@gmail.com wrote:
>
>
>
> 2018. május 14., hétfő 14:35:22 UTC+2 időpontban Jeffrey Walton a 
> következőt írta:
>>
>>
>>
>> On Monday, May 14, 2018 at 2:28:06 AM UTC-4, ant...@gmail.com wrote:
>>>
>>> I cannot use your library without compilation errors when using mingw. I 
>>> am compiling this sample sample
>>>
>>> #include "sha.h"
>>> #include "filters.h"
>>> #include "base64.h"
>>>
>>> std::string SHA256HashString(std::string aString){
>>> std::string digest;
>>> CryptoPP::SHA256 hash;
>>>
>>> /*CryptoPP::StringSource foo(aString, true,
>>> new CryptoPP::HashFilter(hash,
>>>   new CryptoPP::Base64Encoder (
>>>  new CryptoPP::StringSink(digest;*/
>>>
>>> return digest;
>>> }
>>>
>>> I compiled the library before in msys.
>>>
>>
>> Ideally the library and your program are built with the same CXXFLAGS. 
>> What are the CXXFLAGS used by the GNUmakefile when building in your setup? 
>> Can you show the compiler invocation for cryptlib.cpp?
>>
>> For example, on Linux it looks like:
>>
>> $ make cryptlib.o
>> g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>>
>> Or:
>>
>> $ CXX=clang++ make cryptlib.o
>> clang++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>>
>> Uri and Marcel, do you have any experience with this setup?
>>
>> Jeff
>>
>
> I tried to make them the same.
>
> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
> -mconsole -pipe -c hex.cpp
> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
> -mconsole -pipe -c hmac.cpp
> g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
> -mconsole -pipe -c hrtimer.cpp
>
> and compiling the example
> Error executing D:\upp-mingw-11873\upp\bin/mingw64/32/bin\c++.exe -static 
> -mwindows -mthreads -mconsole -o 
> "D:\upp-mingw-11873\upp\out\MyApps\MINGW.\crypto
> pp_test.exe" 
> -Wl,-Map,"D:\upp-mingw-11873\upp\out\MyApps\MINGW.\cryptopp_test.map" 
> -Wl,-s -L"D:\upp-mingw-11873\upp\bin/mingw64/32/i686-w64-mingw32/lib
> " -L"D:\upp-mingw-11873\upp\bin/mingw64/32/opt/lib" -Wl,-O,2 
> -L"d:/libs/cryptopp"  
> "D:/upp-mingw-11873/upp/out/MyApps/cryptopp_test/MINGW.Main\cryptopp
> _test.o" -Wl,--start-group  
> "D:/upp-mingw-11873/upp/out/MyApps/Core/MINGW.\Core.a" 
> "D:/upp-mingw-11873/upp/out/MyApps/plugin/z/MINGW.\z.a" -ladvapi32 -
> lshell32 -lwinmm -lmpr -lole32 -loleaut32 -luuid -lws2_32 -lcryptopp 
> -Wl,--end-group
>
> can you see a significant difference?
>

I see two differences. First, you are using g++ to build the library and 
mingw64/32/bin\c++.exe to build the program. Second, -m64 is present in the 
library build but not the program.

You need to use the same compiler and mostly the same CXXFLAGS to build 
things.

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[cryptopp-users] Re: this simple sample does not compile

2018-05-14 Thread anteus4


2018. május 14., hétfő 14:35:22 UTC+2 időpontban Jeffrey Walton a 
következőt írta:
>
>
>
> On Monday, May 14, 2018 at 2:28:06 AM UTC-4, ant...@gmail.com wrote:
>>
>> I cannot use your library without compilation errors when using mingw. I 
>> am compiling this sample sample
>>
>> #include "sha.h"
>> #include "filters.h"
>> #include "base64.h"
>>
>> std::string SHA256HashString(std::string aString){
>> std::string digest;
>> CryptoPP::SHA256 hash;
>>
>> /*CryptoPP::StringSource foo(aString, true,
>> new CryptoPP::HashFilter(hash,
>>   new CryptoPP::Base64Encoder (
>>  new CryptoPP::StringSink(digest;*/
>>
>> return digest;
>> }
>>
>> I compiled the library before in msys.
>>
>
> Ideally the library and your program are built with the same CXXFLAGS. 
> What are the CXXFLAGS used by the GNUmakefile when building in your setup? 
> Can you show the compiler invocation for cryptlib.cpp?
>
> For example, on Linux it looks like:
>
> $ make cryptlib.o
> g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>
> Or:
>
> $ CXX=clang++ make cryptlib.o
> clang++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp
>
> Uri and Marcel, do you have any experience with this setup?
>
> Jeff
>

I tried to make them the same.

g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
-mconsole -pipe -c hex.cpp
g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
-mconsole -pipe -c hmac.cpp
g++ -DNDEBUG -g2 -O3 -D_WIN32_WINNT=0x0501 -mwindows -m64 -mthreads 
-mconsole -pipe -c hrtimer.cpp

and compiling the example
Error executing D:\upp-mingw-11873\upp\bin/mingw64/32/bin\c++.exe -static 
-mwindows -mthreads -mconsole -o 
"D:\upp-mingw-11873\upp\out\MyApps\MINGW.\crypto
pp_test.exe" 
-Wl,-Map,"D:\upp-mingw-11873\upp\out\MyApps\MINGW.\cryptopp_test.map" 
-Wl,-s -L"D:\upp-mingw-11873\upp\bin/mingw64/32/i686-w64-mingw32/lib
" -L"D:\upp-mingw-11873\upp\bin/mingw64/32/opt/lib" -Wl,-O,2 
-L"d:/libs/cryptopp"  
"D:/upp-mingw-11873/upp/out/MyApps/cryptopp_test/MINGW.Main\cryptopp
_test.o" -Wl,--start-group  
"D:/upp-mingw-11873/upp/out/MyApps/Core/MINGW.\Core.a" 
"D:/upp-mingw-11873/upp/out/MyApps/plugin/z/MINGW.\z.a" -ladvapi32 -
lshell32 -lwinmm -lmpr -lole32 -loleaut32 -luuid -lws2_32 -lcryptopp 
-Wl,--end-group

can you see a significant difference?
 

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[cryptopp-users] Re: this simple sample does not compile

2018-05-14 Thread Jeffrey Walton


On Monday, May 14, 2018 at 2:28:06 AM UTC-4, ant...@gmail.com wrote:
>
> I cannot use your library without compilation errors when using mingw. I 
> am compiling this sample sample
>
> #include "sha.h"
> #include "filters.h"
> #include "base64.h"
>
> std::string SHA256HashString(std::string aString){
> std::string digest;
> CryptoPP::SHA256 hash;
>
> /*CryptoPP::StringSource foo(aString, true,
> new CryptoPP::HashFilter(hash,
>   new CryptoPP::Base64Encoder (
>  new CryptoPP::StringSink(digest;*/
>
> return digest;
> }
>
> I compiled the library before in msys.
>

Ideally the library and your program are built with the same CXXFLAGS. What 
are the CXXFLAGS used by the GNUmakefile when building in your setup? Can 
you show the compiler invocation for cryptlib.cpp?

For example, on Linux it looks like:

$ make cryptlib.o
g++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp

Or:

$ CXX=clang++ make cryptlib.o
clang++ -DNDEBUG -g2 -O3 -fPIC -pthread -pipe -c cryptlib.cpp

Uri and Marcel, do you have any experience with this setup?

Jeff

-- 
You received this message because you are subscribed to "Crypto++ Users". More 
information about Crypto++ and this group is available at 
http://www.cryptopp.com and 
http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cryptopp-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.