JulyIghor / QtBitcoinTrader

Secure multi crypto exchange trading client
https://sourceforge.net/projects/bitcointrader/
730 stars 374 forks source link

Debian 9 (testing) compilation issue in julyaes256.cpp #185

Closed m3mys3lf4ndi closed 7 years ago

m3mys3lf4ndi commented 7 years ago

Since I'm not a programmer and google comes back with nothing I'm posting here: Seems like there some issue in julyaes256.cpp, when running make command it fails with this error:

julyaes256.cpp:44:32: error: ‘EVP_MD_CTX_cleanup’ was not declared in this scope
 EVP_MD_CTX_cleanup(evpMdCtx);
                            ^
julyaes256.cpp:45:12: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
 delete evpMdCtx;
        ^~~~~~~~
julyaes256.cpp:40:17: warning: ‘evpMdCtx’ has incomplete type
 EVP_MD_CTX *evpMdCtx = EVP_MD_CTX_create();
             ^~~~~~~~

It's probably a simple fix but for a noob it can be a show stopper to start using QtBitcoinTrader. Any advice appreciated. Thanks

JulyIghor commented 7 years ago

Which OpenSSL and Qt versions?

m3mys3lf4ndi commented 7 years ago

Ok, I'm getting somewhere. OpenSSL version is OpenSSL 1.1.0e 16 Feb 2017 but Qt seems to be a culprit in my case. As a user qmake --version was returning qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory but I'm sure I was doing export QT_SELECT=5 prior to ./configure (as a user). After doing export QT_SELECT=5 as root I finally got the version as QMake version 3.0 Using Qt version 5.7.1 in /usr/lib/x86_64-linux-gnu which tells me that I'm not running the required version which is >5.8... so the task of getting it up and running on debian testing begins. I'll report back once installed and it still occurs. Thanks

qurczak commented 7 years ago

I have the same problem on Arch linux ;/

Latest commit: Merge: 1c245ac 04884a5 Date: Mon Apr 10 01:06:41 2017 +0300

Packages: openssl 1.1.0.e-1 qt5-base 5.8.0-11

Debug:

g++ -c -pipe -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -std=gnu++11 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_CORE_LIB -D_REENTRANT -I. -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtMultimedia -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtScript -isystem /usr/include/qt/QtCore -I.moc -isystem /usr/include/libdrm -I.ui -isystem /usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/qt/mkspecs/linux-g++ -o .obj/julyaes256.o julyaes256.cpp
julyaes256.cpp: In static member function ‘static QByteArray JulyAES256::sha256(const QByteArray&)’:
julyaes256.cpp:44:32: error: ‘EVP_MD_CTX_cleanup’ was not declared in this scope
     EVP_MD_CTX_cleanup(evpMdCtx);
                                ^
julyaes256.cpp:45:12: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
     delete evpMdCtx;
            ^~~~~~~~
julyaes256.cpp:40:17: warning: ‘evpMdCtx’ has incomplete type
     EVP_MD_CTX *evpMdCtx = EVP_MD_CTX_create();
                 ^~~~~~~~
In file included from /usr/include/openssl/evp.h:14:0,
                 from julyaes256.cpp:33:
/usr/include/openssl/ossl_typ.h:92:16: note: forward declaration of ‘struct evp_md_ctx_st’
 typedef struct evp_md_ctx_st EVP_MD_CTX;
                ^~~~~~~~~~~~~
julyaes256.cpp:45:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
     delete evpMdCtx;
            ^~~~~~~~
julyaes256.cpp: In static member function ‘static QByteArray JulyAES256::encrypt(const QByteArray&, const QByteArray&)’:
julyaes256.cpp:62:12: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
     delete evpCipherCtx;
            ^~~~~~~~~~~~
julyaes256.cpp:54:21: warning: ‘evpCipherCtx’ has incomplete type
     EVP_CIPHER_CTX *evpCipherCtx = EVP_CIPHER_CTX_new();
                     ^~~~~~~~~~~~
In file included from /usr/include/openssl/evp.h:14:0,
                 from julyaes256.cpp:33:
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of ‘struct evp_cipher_ctx_st’
 typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
                ^~~~~~~~~~~~~~~~~
julyaes256.cpp:62:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
     delete evpCipherCtx;
            ^~~~~~~~~~~~
julyaes256.cpp: In static member function ‘static QByteArray JulyAES256::decrypt(const QByteArray&, const QByteArray&)’:
julyaes256.cpp:79:12: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
     delete evpCipherCtx;
            ^~~~~~~~~~~~
julyaes256.cpp:71:21: warning: ‘evpCipherCtx’ has incomplete type
     EVP_CIPHER_CTX *evpCipherCtx = EVP_CIPHER_CTX_new();
                     ^~~~~~~~~~~~
In file included from /usr/include/openssl/evp.h:14:0,
                 from julyaes256.cpp:33:
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of ‘struct evp_cipher_ctx_st’
 typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
                ^~~~~~~~~~~~~~~~~
julyaes256.cpp:79:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
     delete evpCipherCtx;
            ^~~~~~~~~~~~
make: *** [Makefile:3487: .obj/julyaes256.o] Error 1
JulyIghor commented 7 years ago

Please try openssl-1.0.2k and let me know is it works.

qurczak commented 7 years ago

In this case I need to recompile libQt5Network and related packages. I'll try

JulyIghor commented 7 years ago

You need to recompile only if it statically compiled. For shared builds need just change OpenSSL libs.

qurczak commented 7 years ago

I had problems with change my openssl library, so I compiled this app and execute through docker application. It is simpler, but I still have problem with create bitstamp profile, it's not working for me.

JulyIghor commented 7 years ago

Are you sure you use the latest version?

qurczak commented 7 years ago

Yes, i have latest version.

Sometimes, I've got this message and I'm sure that keys are valid. : From now Bitstamp support API keys with permissions. To ensure the security of your Bitstamp account you must create new API keys and add a new profile of Bitstamp to the Qt Bitcoin Trader.

Now I've created new key, and this warning information didn't appear but profile wasn't created. Technically there isn't any error. Strange

qurczak commented 7 years ago

Fixed, I've deleted all settings and it works