简体   繁体   English

Mac OS X上的darwinssl库位置是什么?

[英]What is the darwinssl library location on Mac OS X?

I am trying to compile curl and statically link it to another project. 我正在尝试编译curl并将其静态链接到另一个项目。 I did manage to compile it for my mac architecture(x86_64) and got "libcurl.a". 我确实设法为我的mac架构(x86_64)编译它并得到“libcurl.a”。 Now when I try to build: 现在,当我尝试构建时:

#include <curl/curl.h>

int main()
{
  CURL *curl = curl_easy_init();
}

with g++ tornado.cc -o tornado (path-to-where-it-is)libcurl.a -std=c++11 与g ++ tornado.cc -o tornado(path-to-where-it-is)libcurl.a -std = c ++ 11

I get: 我明白了:

Undefined symbols for architecture x86_64:
  "_CFArrayAppendValue", referenced from:
      _append_cert_to_array in libcurl.a(libcurl_la-darwinssl.o)
  "_CFArrayCreate", referenced from:
      _darwinssl_connect_common in libcurl.a(libcurl_la-darwinssl.o)
  "_CFArrayCreateMutable", referenced from:
      _darwinssl_connect_step2 in libcurl.a(libcurl_la-darwinssl.o)
  "_CFArrayGetCount", referenced from:
      _darwinssl_connect_common in libcurl.a(libcurl_la-darwinssl.o)
  "_CFArrayGetValueAtIndex", referenced from:
      _darwinssl_connect_common in libcurl.a(libcurl_la-darwinssl.o)
  "_CFDataCreate", referenced from:
      _append_cert_to_array in libcurl.a(libcurl_la-darwinssl.o)

As I understand it wants to get links for darwinssl, but I do not know where to get those. 据我所知,它希望获得darwinssl的链接,但我不知道从哪里获得这些链接。

The readme for curl ( https://github.com/biasedbit/curl-ios-build-scripts/blob/master/README.md ) - does mention it depends on libz.dylib and Security.framework but does not give any clues about what they are, when and how do I need them, and how to include those. curl的自述文件( https://github.com/biasedbit/curl-ios-build-scripts/blob/master/README.md )确实提到它取决于libz.dylib和Security.framework,但没有提供任何线索关于它们是什么,何时以及如何需要它们,以及如何包含它们。

PS the regular curl inclusion works fine: g++ tornado.cc -o tornado -lcurl -std=c++11 PS常规卷曲包含工作正常: g++ tornado.cc -o tornado -lcurl -std=c++11

I found some time to mess around on the mac. 我发现有时间在Mac上乱搞。 Here's the command that worked for me: 这是对我有用的命令:

gcc main.cpp -I path/to/include path/to/libcurl.a -framework Foundation -lz -framework Security

Basically, you need -framework Foundation , -lz and -framework Security . 基本上,您需要-framework Foundation-lz-framework Security

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM