otclient icon indicating copy to clipboard operation
otclient copied to clipboard

MacOSX compilation problem

Open daszyja opened this issue 4 years ago • 9 comments

Hello, i have problem during OSX compilation process: otclient/src/framework/util/crypt.cpp:270:13: error: use of undeclared identifier 'n' mpz_mul(n, p, q); ^ 1 error generated. make[2]: *** [CMakeFiles/otclient.dir/src/framework/util/crypt.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/otclient.dir/all] Error 2

I'm using https://github.com/edubart/otclient/wiki/Compiling-on-Mac-OS-X ofc I got M1 Macbook.

ofc: gmp 6.2.1_1 is already installed and up-to-date

daszyja avatar Nov 09 '21 13:11 daszyja

Same on Intel MacBook.

Jankowsky avatar Nov 11 '21 13:11 Jankowsky

Can you try changing https://github.com/edubart/otclient/blob/e73f6df221d9353749e044d4bdf85b5e2598d1a1/src/framework/util/crypt.cpp#L270

-    mpz_mul(n, p, q);
+    mpz_mul(m_n, m_p, m_q);

marmichalski avatar Nov 15 '21 22:11 marmichalski

GMP seems to not be working at all anyway. Just install openssl: brew install [email protected] 🙄

marmichalski avatar Nov 15 '21 23:11 marmichalski

Tried already, any improvement

Jankowsky avatar Nov 16 '21 15:11 Jankowsky

Tried already, any improvement

There are a few ways you can get cmake to find openssl on macOS, some of that, but not all, include:

  1. Trying to force link with brew
  2. Manually telling cmake where to look at by setting correct definitions with -D
  3. Symlinking openssl on your own

marmichalski avatar Nov 16 '21 15:11 marmichalski

Use brew install [email protected] and next this command : export PATH="/usr/local/opt/[email protected]/bin:$PATH" with this changes in code : mpz_mul(m_n, m_p, m_q);

Jankowsky avatar Nov 24 '21 16:11 Jankowsky

Use brew install [email protected] and next this command : export PATH="/usr/local/opt/[email protected]/bin:$PATH" with this changes in code : mpz_mul(m_n, m_p, m_q);

When you are using OpenSSL that part of code is not used. Anyway, it does not fix anything, as GMP integration seems to be broken.

marmichalski avatar Nov 24 '21 22:11 marmichalski

any ideas?

daszyja avatar Dec 08 '21 00:12 daszyja

Can you try changing

https://github.com/edubart/otclient/blob/e73f6df221d9353749e044d4bdf85b5e2598d1a1/src/framework/util/crypt.cpp#L270

-    mpz_mul(n, p, q);
+    mpz_mul(m_n, m_p, m_q);

this did it for me. thanks!

nickolasdeluca avatar Apr 08 '22 22:04 nickolasdeluca