question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

linker command failed with exit code 1 (use -v to see invocation) with v2.3.3

See original GitHub issue

Failed to install node-rdkafka v2.3.3 with the following error

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Mac
  • Node Version [e.g. 8.2.1]: 8.9.4
  • NPM Version [e.g. 5.4.2]: 5.6.0
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: g++
  • node-rdkafka version [e.g. 2.3.3]: 2.3.3

Steps to Reproduce npm install -S node-rdkakfa

Additional context

Creating shared library librdkafka.1.dylib
gcc -L/Users/raghu/martel-marketo2/node_modules/node-rdkafka/build/deps -shared -dynamiclib -Wl,-install_name,/Users/raghu/martel-marketo2/node_modules/node-rdkafka/build/deps/librdkafka.1.dylib rdkafka.o rdkafka_broker.o rdkafka_msg.o rdkafka_topic.o rdkafka_conf.o rdkafka_timer.o rdkafka_offset.o rdkafka_transport.o rdkafka_buf.o rdkafka_queue.o rdkafka_op.o rdkafka_request.o rdkafka_cgrp.o rdkafka_pattern.o rdkafka_partition.o rdkafka_subscription.o rdkafka_assignor.o rdkafka_range_assignor.o rdkafka_roundrobin_assignor.o rdkafka_feature.o rdcrc32.o crc32c.o rdmurmur2.o rdaddr.o rdrand.o rdlist.o tinycthread.o rdlog.o rdstring.o rdkafka_event.o rdkafka_metadata.o rdregex.o rdports.o rdkafka_metadata_cache.o rdavl.o rdkafka_sasl.o rdkafka_sasl_plain.o rdkafka_interceptor.o rdkafka_msgset_writer.o rdkafka_msgset_reader.o rdkafka_header.o rdvarint.o rdbuf.o rdunittest.o rdkafka_sasl_cyrus.o rdkafka_sasl_scram.o snappy.o rdgz.o rdkafka_lz4.o xxhash.o lz4.o lz4frame.o lz4hc.o rddl.o rdkafka_plugin.o -o librdkafka.1.dylib -lsasl2 -L/usr/local/Cellar/openssl/1.0.2o_1/lib -lssl  -lz -ldl -lpthread
Undefined symbols for architecture x86_64:
  "_BIO_ctrl", referenced from:
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_f_base64", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_free_all", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_new", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_new_mem_buf", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
  "_BIO_push", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_read", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
  "_BIO_s_mem", referenced from:
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_set_flags", referenced from:
      _rd_kafka_sasl_scram_fsm in rdkafka_sasl_scram.o
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_BIO_write", referenced from:
      _rd_base64_encode in rdkafka_sasl_scram.o
  "_CRYPTO_cleanup_all_ex_data", referenced from:
      _rd_kafka_transport_ssl_term in rdkafka_transport.o
  "_CRYPTO_num_locks", referenced from:
      _rd_kafka_transport_ssl_init in rdkafka_transport.o
  "_CRYPTO_set_id_callback", referenced from:
      _rd_kafka_transport_ssl_term in rdkafka_transport.o
      _rd_kafka_transport_ssl_init in rdkafka_transport.o
  "_CRYPTO_set_locking_callback", referenced from:
      _rd_kafka_transport_ssl_term in rdkafka_transport.o
      _rd_kafka_transport_ssl_init in rdkafka_transport.o
  "_ERR_error_string_n", referenced from:
      _rd_kafka_ssl_error in rdkafka_transport.o
  "_ERR_get_error_line_data", referenced from:
      _rd_kafka_ssl_error in rdkafka_transport.o
  "_ERR_remove_thread_state", referenced from:
      _rd_kafka_broker_thread_main in rdkafka_broker.o
  "_EVP_PKEY_free", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_EVP_PKEY_new", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_EVP_sha1", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_EVP_sha256", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_EVP_sha512", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_HMAC", referenced from:
      _rd_kafka_sasl_scram_Hi in rdkafka_sasl_scram.o
      _rd_kafka_sasl_scram_HMAC in rdkafka_sasl_scram.o
  "_OPENSSL_add_all_algorithms_noconf", referenced from:
      _rd_kafka_transport_ssl_init in rdkafka_transport.o
  "_PKCS12_free", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_PKCS12_parse", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_SHA1", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_SHA256", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_SHA512", referenced from:
      _rd_kafka_sasl_scram_conf_validate in rdkafka_sasl_scram.o
  "_X509_STORE_set_flags", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_X509_free", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
      _rd_kafka_transport_io_serve in rdkafka_transport.o
  "_X509_new", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_X509_verify_cert_error_string", referenced from:
      _rd_kafka_transport_io_serve in rdkafka_transport.o
  "_d2i_PKCS12_fp", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.o
  "_sk_pop_free", referenced from:
      _rd_kafka_transport_ssl_ctx_init in rdkafka_transport.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[2]: *** [librdkafka.1.dylib] Error 1
make[1]: *** [libs] Error 2
make: *** [_Users_raghu_martel_marketo2_node_modules_node_rdkafka_deps_librdkafka_gyp_librdkafka_target_build_dependencies.intermediate] Error 2
rm _Users_raghu_martel_marketo2_node_modules_node_rdkafka_deps_librdkafka_gyp_librdkafka_target_build_dependencies.intermediate
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/raghu/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/Users/raghu/.nvm/versions/node/v8.9.4/bin/node" "/Users/raghu/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/raghu/martel-marketo2/node_modules/node-rdkafka
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN martel-marketo@0.0.9 No license field.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

24reactions
cagedcommented, May 21, 2018

I ran into a similar error on node 9.5.0 using npm 6.0.1. I have openssl installed through homebrew and was able to successfully install using:

CFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib npm install --save node-rdkafka
0reactions
zhengdaicommented, Dec 9, 2020

CFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib npm install --save node-rdkafka

works for me on mac big sur

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linker Command failed with exit code 1 (use - Stack Overflow
Just go to Select Project -> Build Settings -> Search for Enable Bitcode -> If it is selected to Yes, select No. That...
Read more >
clang: error: linker command faile… | Apple Developer Forums
The error I get is: clang: error: linker command failed with exit code 1 (use -v to see invocation). How should I go...
Read more >
What is linker command failed with exit code 1 (use - Quora
It means the link failed. This is most likely caused by an undefined external reference, or a duplicate external definition. Since you did...
Read more >
iOS : Linker Command failed with exit code 1 (use - YouTube
iOS : Linker Command failed with exit code 1 ( use - v to see invocation ), Xcode 8, Swift 3 [ Gift...
Read more >
linker command failed with exit code 1 react native - You.com
Linker command failed with exit code 1 is an error that occurs because the program consists of either undefined symbols or duplicate symbols...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found