Compilation on Linux seems outdated

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

Philou231
Posts: 2
Joined: 18 Jun 2020, 16:34

Compilation on Linux seems outdated

Postby Philou231 » 18 Jun 2020, 16:55

Greetings to the SmartFoxServer team!
First of all, thank you for SFS2X. I am using the C++ API to build communication between computers (rather than using it for an MMO) but I might use it for video games in the future :D

I managed to build the API on Windows with "no" problem. The API works perfectly in my project.
However, I am now trying to build my project on Linux Mint and I am hitting a wall... I carefully followed each step provided in the guide (http://docs2x.smartfoxserver.com/GettingStarted/client-api-cpp-linux-eclipse) but I blocked at the point of compiling the SFS2X Client API. I don't quite know what the problem is so I will let the error messages speak for themselves.

The relevant part is this one:

Code: Select all

Building file: ../Util/CryptoInitializer.cpp
Invoking: Cross G++ Compiler
g++ -DSMARTFOXCLIENTAPI_EXPORTS -DBOOST_THREAD_PROVIDES_FUTURE -I"/home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix" -I"/home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include" -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -pthread -fPIC -MMD -MP -MF"Util/CryptoInitializer.d" -MT"Util/CryptoInitializer.o" -o "Util/CryptoInitializer.o" "../Util/CryptoInitializer.cpp"
In file included from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include/openssl/evp.h:66:0,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include/openssl/x509.h:73,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include/openssl/ssl.h:156,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_types.hpp:20,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/context_base.hpp:19,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/context.hpp:27,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl.hpp:19,
                 from ../Util/CryptoInitializer.cpp:18:
/usr/include/x86_64-linux-gnu/openssl/opensslconf.h:20:3: error: #error OPENSSL_ALGORITHM_DEFINES no longer supported
 # error OPENSSL_ALGORITHM_DEFINES no longer supported
   ^~~~~
In file included from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include/openssl/ssl.h:165:0,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/detail/openssl_types.hpp:20,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/context_base.hpp:19,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl/context.hpp:27,
                 from /home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/BoostAsio/Unix/boost/asio/ssl.hpp:19,
                 from ../Util/CryptoInitializer.cpp:18:
/home/philou231/Documents/libraries/SFS2X_API_Cpp_v1.7.5/Core/OpenSSL/Unix/include/openssl/kssl.h:72:10: fatal error: krb5.h: No such file or directory
 #include <krb5.h>
          ^~~~~~~~
compilation terminated.
make: *** [Util/CryptoInitializer.o] Error 1
Util/subdir.mk:45: recipe for target 'Util/CryptoInitializer.o' failed
"make all" terminated with exit code 2. Build might be incomplete.


I tried commenting the call to define #OPENSSL_ALGORITHM_DEFINES but the error for the include krb5.h persisted. I tried installing krb5-user, krb5-config and krb5-multidev but without luck. (I have not searched to understand what that is).

My Linux Mint version is 19.3 (Linux Kernel 5.4.0-37-generic)
The SFS2X API Version is 1.7.5
Everything on my system is updated and upgrade to their current version. (I installed linux yesterday)

I am able to compile on linux and I have used it enough to understand the basics (disclaimer, in case I need to do some "technical stuff" to fix the problem)

I am very grateful for this software that you are providing free of charge and any help will be greatly appreciated.
Philou231
Philou231
Posts: 2
Joined: 18 Jun 2020, 16:34

Re: Compilation on Linux seems outdated

Postby Philou231 » 25 Jun 2020, 02:01

Hello again!

I have decided to take a fresh look at the problem today and I have made some progress. There were two errors in my previous log and I have solved one of them. The "fatal error: krb5.h: No such file or directory" was simply a matter of finding the right library. It turns out that it was "libkrb5-dev". I don't know how I missed that on my first look... What matters is that it is solved.

For the second part, the "error: #error OPENSSL_ALGORITHM_DEFINES no longer supported", it is more complicated... I tried simply commenting the only line of code were there is this reference but I don't thing it really solved the problem. The weird thing is that the Client API managed to compile! I tought I had solved the problem but I just kicked the can further down the road.

When I tried to compile my project some errors appeared. "undefined reference to ..." (a list of about two dozen tags, among which: ENGINE_cleanup, EVP_CIPHER_CTX_cleanup, SSLv2_client_method, etc.). This would indicate that I have not linked some library but I did! I linked everything there is to link (I think)... What I think is the problem is the use of an old (the one provided) and a new (the one on my computer) SSL. I feel like there should be an update about this ssl stuff. I am no expert so maybe I made a compiling mistake too...

I would be quite curious to know if someone managed to compile on Linux (debian or derived if possible) recently (last year or so).

As always, thanks a lot for any help that can be provided,
Philou231

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 5 guests