Ld Library Not Found For Lssl Mac Mysql


解决库移位出现的 ld: library not found for -lXXX. 在Pod里,有个第三方库不更新了,但是里面的警告挺多的,开发组老大让我把它单独挪出来,把警告处理掉,期间遇到了一个坑,于是就有了这篇文章。 如约,Pods工程目录下,把Posfile里的那个库注释掉,然后: pod install. Both errors are related to the OpenSSL development libraries not being installed ( -lssl is a pretty dead giveway). The -lssl can be divided into -l, meaning 'link with', and ssl, which is the desired library gcc is asked to link in. Usually, the file to link in is named lib.a and it needs the headers. The file and headers are in the dev (Debian-based) or devel. Both errors are related to the OpenSSL development libraries not being installed ( -lssl is a pretty dead giveway). The -lssl can be divided into -l, meaning 'link with', and ssl, which is the desired library gcc is asked to link in. Usually, the file to link in is named lib.a and it needs the headers. I'm using a library that is compiled for both Mac and Linux. It uses boost IO for a network client. I tried removing -lssl and -lcrypto and boy, did that leave a lot of unresolved references. I don't understand how I can specify -L/usr/lib, then look in /usr/lib and see a bunch of libssl dylibs, but the linker says -lssl not found. Mysqlconfig was found /usr/local/mysql/bin. Bug is not repeatable on Mac OSX 10.4. Mysql/lib -lmysqlclientr -lz -lm -lmygcc ld: library not found for.

Posted by: Jesper Kückelhahn
Date: October 28, 2007 10:36AM

Hello
I've tried the mentioned method, but it doesn't seem to be working for me.
When i run 'python setup.py build', after editing the '_mysql.c' file, I get:
$python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.5-ppc-2.5
copying _mysql_exceptions.py -> build/lib.macosx-10.5-ppc-2.5
creating build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb
creating build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.5-ppc-2.5/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.5-ppc-2.5
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -pipe -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c _mysql.c -o build/temp.macosx-10.5-ppc-2.5/_mysql.o -Os -arch ppc -fno-common
gcc -Wl,-F. -bundle -undefined dynamic_lookup -arch i386 -arch ppc build/temp.macosx-10.5-ppc-2.5/_mysql.o -L/usr/local/mysql/lib/mysql -lmysqlclient_r -lz -lm -o build/lib.macosx-10.5-ppc-2.5/_mysql.so
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
ld: library not found for -lmysqlclient_r
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/t8/t8u1GUW6GN8KS24sFWb-IU+++TI/-Tmp-//ccLjJt3J.out (No such file or directory)
error: command 'gcc' failed with exit status 1
Any else had that problem ?
Can it be because I'm using a PowerBook, and not an Intel Mac?
- Jesper
UPDATE:
Seems it was kind of the same solution as mentioned, except I had to do:
sudo cp /usr/local/mysql/lib/libmysqlclient* /usr/local/mysql/lib/mysql/
before I did a build, and then it works just fine.
Edited 1 time(s). Last edit at 10/29/2007 07:28AM by Jesper Kückelhahn.

Options:Reply•Quote
Ld Library Not Found For Lssl Mac Mysql
Ld Library Not Found For Lssl Mac Mysql
Written By

Mac Library Not Found For Lssl


Command
Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.

Jun 29th, 2019
Never
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
  1. If you get the following errer while installing the mysql2 gem on Mac OS Mojave, make sure you have open ssl installed on your machine (`brew install openssl`) and retry installing the gem with:
  2. `gem install mysql2 -v '0.5.2' -- --with-ldflags=-L$(brew --prefix openssl)/lib --with-cppflags=-I$(brew --prefix openssl)/include`
  3. The stack trace line saying `ld: library not found for -lssl` will give you the hint about what information is missing (ssl lib not found).
  4. ```
  5. Building native extensions with: '--with-mysql-config=/usr/local/opt/mysql/bin/mysql_config'
  6. ERROR: Error installing mysql2:
  7. current directory: /Users/r.wrede/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/gems/mysql2-0.5.2/ext/mysql2
  8. /Users/r.wrede/.rbenv/versions/2.4.6/bin/ruby -r ./siteconf20190618-2638-etjqij.rb extconf.rb --with-mysql-config=/usr/local/opt/mysql/bin/mysql_config
  9. checking for rb_absint_singlebit_p()... yes
  10. -----
  11. Using mysql_config at /usr/local/opt/mysql/bin/mysql_config
  12. checking for mysql.h... yes
  13. checking for SSL_MODE_DISABLED in mysql.h... yes
  14. checking for SSL_MODE_REQUIRED in mysql.h... yes
  15. checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
  16. checking for MYSQL.net.pvio in mysql.h... no
  17. checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
  18. checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
  19. checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
  20. checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
  21. checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
  22. checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
  23. -----
  24. Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
  25. -----
  26. -----
  27. current directory: /Users/r.wrede/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/gems/mysql2-0.5.2/ext/mysql2
  28. current directory: /Users/r.wrede/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/gems/mysql2-0.5.2/ext/mysql2
  29. compiling client.c
  30. compiling mysql2_ext.c
  31. compiling statement.c
  32. ld: library not found for -lssl
  33. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  34. Gem files will remain installed in /Users/r.wrede/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/gems/mysql2-0.5.2 for inspection.
  35. Results logged to /Users/r.wrede/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-18/2.4.0-static/mysql2-0.5.2/gem_make.out

Ld Library Not Found For Lssl Mac Mysql Tutorial