node icon indicating copy to clipboard operation
node copied to clipboard

XCode 7: library not found for -lgcc_s.10.5

Open jonathanong opened this issue 11 years ago • 35 comments

my coworkers and i are running into this issue after updating to XCode 7 automatically today on 10.10.5. not sure what to do.

just running npm i bcrypt gets the following:

> [email protected] install /Users/jong/Workspace/jonathanong/node.bcrypt.js
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/bcrypt_lib.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/bcrypt_lib.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/jong/.nvm/versions/io.js/v2.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/Users/jong/.nvm/versions/io.js/v2.5.0/bin/iojs" "/Users/jong/.nvm/versions/io.js/v2.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/jong/Workspace/jonathanong/node.bcrypt.js
gyp ERR! node -v v2.5.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 

npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/jong/.nvm/versions/io.js/v2.5.0/bin/iojs" "/Users/jong/.nvm/versions/io.js/v2.5.0/bin/npm" "i"
npm ERR! node v2.5.0
npm ERR! npm  v2.13.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jong/Workspace/jonathanong/node.bcrypt.js/npm-debug.log

specifically:

ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)

i've been looking for solutions online but none really work. this happens on node v2 and v4 for me. this happens for any package i have that requires compilation.

jonathanong avatar Sep 17 '15 18:09 jonathanong

See https://github.com/nodejs/node-gyp/issues/734, you need to install both xcode 7 and the new command line tools. Closing, it's not an issue with node or node-gyp.

bnoordhuis avatar Sep 17 '15 18:09 bnoordhuis

Oh, you may also need to run sudo xcode-select -s /path/to/xcode/Contents/Developer.

bnoordhuis avatar Sep 17 '15 18:09 bnoordhuis

oh my god it updated the command line tools w/o updating xcode!? sigh... thanks!!!

jonathanong avatar Sep 17 '15 18:09 jonathanong

I still get this error! I've upgraded both Xcode 7 and Command Line Tools.

> [email protected] install /Users/Kyle/Documents/Software/mean/mean_scotch/node_modules/bcrypt
> node-gyp rebuild

  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/bcrypt_lib.node
ld: library not found for -lgcc_s.10.5
collect2: error: ld returned 1 exit status
make: *** [Release/bcrypt_lib.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Kyle/Documents/Software/mean/mean_scotch/node_modules/bcrypt
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "bcrypt"
npm ERR! node v4.1.0
npm ERR! npm  v3.3.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls bcrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

I tried reinstalling the old command line tools then upgrading again, and i made sure xcode-select had the correct path.

Reobos avatar Sep 20 '15 01:09 Reobos

I get the same error with both, xcode and command line tools updated.

PhilippKrone avatar Sep 21 '15 09:09 PhilippKrone

I thought I was getting this error yesterday on xcode 7. However, (I am a new mac user) in the app store there was another update for Yosemite just called 'Software Update' and it seems like that simple title encapsulates updates to the command line tools and other things... if thats there then make sure you have all updates being run. I am on the most recent version of react native and node and npm if that counts for anything... @PhilippKrone

JakeRuth avatar Sep 21 '15 12:09 JakeRuth

I got the same error here, a possible error after upgrading xcode version. I fix it with a temp solution: cd /usr/local/lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

italoag avatar Sep 21 '15 17:09 italoag

Thanks italoag, that works for me on a different issue with install pyfftw

stringhamc avatar Sep 22 '15 16:09 stringhamc

Thanks italoag!

kwcto avatar Sep 22 '15 18:09 kwcto

I found that installing Xcode 7 - and running Xcode at least once, solved the problem.

58bits avatar Sep 23 '15 07:09 58bits

Had the same problem with compiling C code (in python code) using CC=gcc-mp-4.9 python setup.py develop and missing library not found for -lgcc_s.10.5 (on Xcode 7). What solved the problem was @italoag 's cd /usr/local/lib sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

wkerzendorf avatar Sep 23 '15 12:09 wkerzendorf

:+1: for @italoag's suggestion. saves me from having to install 4 gigs of Xcode when all I needed was 170 megs for the command line tools.

adityabansod avatar Sep 23 '15 17:09 adityabansod

I'm using macports and still had problems compiling until I changed the python version with the command

sudo port select --set python python27-apple

Then it installed successfully

Reobos avatar Sep 24 '15 05:09 Reobos

I had this error, which I solved by updating version for node and npm. http://stackoverflow.com/questions/6237295/how-can-i-update-node-js-and-npm-to-the-next-versions

chris1248 avatar Sep 30 '15 16:09 chris1248

Thanks @58bits my problem solved by XCode 7 update.

huseyinbabal avatar Nov 05 '15 13:11 huseyinbabal

Thx @italoag, work for me.

xudafeng avatar Nov 05 '15 16:11 xudafeng

Was getting the error trying to install node-inspector. Avoided upgrading to Xcode 7 (stayed at 6.1) by using @italoag's sym link workaround.

Thanks @italoag !!

bgerd avatar Nov 23 '15 23:11 bgerd

Tanks to @italoag works for me too.

dgmike avatar Nov 24 '15 20:11 dgmike

Thanks to @italoag works for me too ~

ielgnaw avatar Nov 28 '15 17:11 ielgnaw

Thanks to @italoag works for me too..

wushaobo avatar Dec 08 '15 07:12 wushaobo