2017-01-10 2 views
1

Building libCURL for iOS 4.2Как установить libcurl под MacOS10.12 и использовать для Xcode?

Здравствуйте, ребята: Это мой первый вопрос переполнения стека. Я прочитал ранее размещенный блог, но я до сих пор не могу закончить строительство. Я не знаком с терминальным программированием. Сначала позвольте мне показать вам базовую информацию о xcode на моем mac.

`Wuqians-MBP:~ wuqianzhong$ xcode-select -p 
/Applications/Xcode.app/Contents/Developer 
Wuqians-MBP:~ wuqianzhong$ g++ -v 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 8.0.0 (clang-800.0.42.1) 
Target: x86_64-apple-darwin16.3.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin` 

Тогда я напечатал следующие 4 строки, извлеченные из блога Building libCURL for iOS 4.2.

export CC=“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang” 

export CFLAGS="-arch x86_64 -pipe -Os -gdwarf-2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Deveoper/SDKs/iPhoneOS10.2.sdk" 

export LDFLAGS="-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.2.sdk" 

 ./configure --host=x86_64-apple-darwin --with-zlib --disable-shared --enable-static --disable-ipv6 --disable-manual --disable-verbose 

Однако результат показывает, что я не правильно строить. Даже C-компилятор не работает.

checking whether to enable maintainer-specific portions of Makefiles... no 
checking whether make supports nested variables... yes 
checking whether to enable debug build options... no 
checking whether to enable compiler optimizer... (assumed) yes 
checking whether to enable strict compiler warnings... no 
checking whether to enable compiler warnings as errors... no 
checking whether to enable curl debug memory tracking... no 
checking whether to enable hiding of library internal symbols... yes 
checking whether to enable c-ares for DNS lookups... no 
checking whether to disable dependency on -lrt... (assumed no) 
checking for path separator... : 
checking for sed... /usr/bin/sed 
checking for grep... /usr/bin/grep 
checking for egrep... /usr/bin/grep -E 
checking for x86_64-apple-darwin-ar... no 
checking for ar... /usr/bin/ar 
checking for a BSD-compatible install... /usr/bin/install -c 
checking for x86_64-apple-darwin-gcc... “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang” 
checking whether the C compiler works... no 
configure: error: in `/Users/wuqianzhong/Desktop/curl-7.52.1': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
+0

Как насчет './Configure',' make' и 'make install'? –

+0

Не видя config.log, это все догадывается. Возможно, вы не согласились с условиями в Xcode, иначе может отсутствовать критическая библиотека, или скрипт configure может добавлять фальшивые флаги или ... Файл config.log должен сообщить, что пошло не так в компиляции. – dgatwood

ответ

7

How to install libcurl in Mac

Эй, я думаю, что я нашел ответ, и это работает!

  1. Скачать curl установить пакет и извлечь его
  2. Использование терминала для ввода локон папку установки пакета корневой каталог
  3. Установить путь установки: ./configure --prefix=/usr/local/curl
  4. Compile: make
  5. Установка: sudo make install

Затем вы найдете завиток в пути/usr/local/curl with fou r документы bin, include, lib, share.

+3

Эй, ребята, мне гораздо проще использовать libcurl на Mac xcode. Mac OS уже создала его, и вы можете напрямую найти его в /usr/lib/libcurl.dylib и добавить его в свой проект xcode. – Bob

Смежные вопросы