如何在MacOS10.12下安装libcurl并用于Xcode?

如何在MacOS10.12下安装libcurl并用于Xcode?,第1张

概述Building libCURL for iOS 4.2 大家好:       这是我的第一个堆栈溢出问题.我已经阅读过之前发布的博客,但我还是无法完成构建.我不熟悉终端编程.首先让我向您展示一些关于我的Mac上的xcode的基本信息. `Wuqians-MBP:~ wuqianzhong$xcode-select -p/Applications/Xcode.app/Contents/Devel Building libCURL for iOS 4.2

大家好:
      这是我的第一个堆栈溢出问题.我已经阅读过之前发布的博客,但我还是无法完成构建.我不熟悉终端编程.首先让我向您展示一些关于我的Mac上的xcode的基本信息.

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

然后我输入了从博客Building libCURL for iOS 4.2.中学到的以下4行

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... nochecking whether make supports nested variables... yeschecking whether to enable deBUG build options... nochecking whether to enable compiler optimizer... (assumed) yeschecking whether to enable strict compiler warnings... nochecking whether to enable compiler warnings as errors... nochecking whether to enable curl deBUG memory tracking... nochecking whether to enable hIDing of library internal symbols... yeschecking whether to enable c-ares for DNS lookups... nochecking whether to disable dependency on -lrt... (assumed no)checking for path separator... :checking for sed... /usr/bin/sedchecking for grep... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for x86_64-apple-darwin-ar... nochecking for ar... /usr/bin/archecking for a BSD-compatible install... /usr/bin/install -cchecking for x86_64-apple-darwin-gcc... “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang”checking whether the C compiler works... noconfigure: error: in `/Users/wuqianzhong/Desktop/curl-7.52.1':configure: error: C compiler cannot create executablesSee `config.log' for more details
解决方法 How to install libcurl in Mac

嘿,我想我找到了答案,它确实有效!

>下载curl安装包并解压缩
>使用terminal进入curl install package文件夹根目录
>设置安装路径:./ configure –prefix = /usr/local/curl
>编译:make
>安装:sudo make install

然后你会发现路径/usr/local/curl中的curl有四个文件bin,include,lib,share.

总结

以上是内存溢出为你收集整理的如何在MacOS10.12下安装libcurl并用于Xcode?全部内容,希望文章能够帮你解决如何在MacOS10.12下安装libcurl并用于Xcode?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1028923.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存