Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on macOS 10.15.6 #385

Closed
SeptemberHX opened this issue Aug 25, 2020 · 5 comments
Closed

Cannot build on macOS 10.15.6 #385

SeptemberHX opened this issue Aug 25, 2020 · 5 comments
Labels

Comments

@SeptemberHX
Copy link

gcc -g -O2 -I/usr/local/opt/openssl@1.1/include -I ./include        -c -o src/edge.o src/edge.c
src/edge.c:855:40: error: implicit declaration of function 'OpenSSL_version' is invalid in C99
      [-Werror,-Wimplicit-function-declaration]
  traceEvent(TRACE_NORMAL, "Using %s", OpenSSL_version(0));
                                       ^
1 error generated.
make: *** [src/edge.o] Error 1

After searching with Google, I solved the problem above by adding #include <openssl/crypto.h> in src/edge.c.

And another problem appeared:

/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libn2n.a(transform_aes.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libn2n.a(tuntap_freebsd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libn2n.a(tuntap_netbsd.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libn2n.a(tuntap_linux.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libn2n.a(edge_utils_win32.o) has no symbols
gcc -g -O2 -I/usr/local/opt/openssl@1.1/include -I ./include      src/edge.c -L/usr/local/opt/openssl@1.1/lib/ libn2n.a  -o edge
Undefined symbols for architecture x86_64:
  "_BIO_ctrl", referenced from:
      _openssl_err_as_string in libn2n.a(transform_cc20.o)
  "_BIO_free", referenced from:
      _openssl_err_as_string in libn2n.a(transform_cc20.o)
  "_BIO_new", referenced from:
      _openssl_err_as_string in libn2n.a(transform_cc20.o)
  "_BIO_s_mem", referenced from:
      _openssl_err_as_string in libn2n.a(transform_cc20.o)
  "_ERR_print_errors", referenced from:
      _openssl_err_as_string in libn2n.a(transform_cc20.o)
  "_EVP_CIPHER_CTX_free", referenced from:
      _transop_deinit_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_CIPHER_CTX_new", referenced from:
      _n2n_transop_cc20_init in libn2n.a(transform_cc20.o)
  "_EVP_CIPHER_CTX_reset", referenced from:
      _transop_encode_cc20 in libn2n.a(transform_cc20.o)
      _transop_decode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_CIPHER_CTX_set_padding", referenced from:
      _transop_encode_cc20 in libn2n.a(transform_cc20.o)
      _transop_decode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_DecryptFinal_ex", referenced from:
      _transop_decode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_DecryptInit_ex", referenced from:
      _transop_decode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_DecryptUpdate", referenced from:
      _transop_decode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_EncryptFinal_ex", referenced from:
      _transop_encode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_EncryptInit_ex", referenced from:
      _transop_encode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_EncryptUpdate", referenced from:
      _transop_encode_cc20 in libn2n.a(transform_cc20.o)
  "_EVP_chacha20", referenced from:
      _n2n_transop_cc20_init in libn2n.a(transform_cc20.o)
  "_OpenSSL_version", referenced from:
      _main in edge-26e9d0.o
  "_SHA256", referenced from:
      _n2n_transop_cc20_init in libn2n.a(transform_cc20.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [edge] Error 1

Solved successfully by modifying configure.ac with N2N_LIBS=-lcrypto

@jonahzheng
Copy link

try 2.6-stable
#278

@jonahzheng
Copy link

@SeptemberHX you can pull one request.

@SeptemberHX
Copy link
Author

@SeptemberHX you can pull one request.

I'd like to pull one request, but I don't think it's the best solution to modify configure.ac with N2N_LIBS=-lcrypto since I saw AC_CHECK_LIB([crypto], [AES_cbc_encrypt]) in configure.ac.
I am not familiar with configure.ac, so I decided to post my solution and wait for others to provide a more elegant way to solve it.

@Logan007
Copy link
Collaborator

Logan007 commented Jan 7, 2021

Is this still an issue?

@Logan007 Logan007 added the bug label Jan 7, 2021
@SeptemberHX
Copy link
Author

SeptemberHX commented Jan 7, 2021

Is this still an issue?

Just test with the dev branch, and it works fine wit Big Sur now. Thanks for your work !

pojntfx added a commit to pojntfx/gon2n that referenced this issue Feb 3, 2021
pojntfx added a commit to pojntfx/gon2n that referenced this issue Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants