我正在尝试在Mac OS X 10.8.3计算机上编译cgminer。我使用自制软件安装了libcurl。花了一段时间才能使./configure正常工作,但我终于做到了(请参阅此问题How do I specify LDFLAGS and CPPFLAGS for ./configure?)。

现在,当我尝试对该程序进行make时,出现了似乎与Undefined symbols for architecture x86_64相关的错误curl。这是从头到尾的完整make消息:

c10:cgminer-3.0.0 haroldbr$ make
make  all-recursive
Making all in lib
  GEN    signal.h
  GEN    stdint.h
  GEN    string.h
make  all-recursive
  CC     memmem.o
  AR     libgnu.a
/usr/bin/ranlib: file: libgnu.a(dummy.o) has no symbols
ranlib: file: libgnu.a(dummy.o) has no symbols
Making all in compat
make[3]: Nothing to be done for `all-am'.
Making all in ccan
  CC     libccan_a-helpers.o
  CC     libccan_a-opt.o
  CC     libccan_a-parse.o
  CC     libccan_a-usage.o
  AR     libccan.a
  CC     cgminer-cgminer.o
  CC     cgminer-util.o
  CC     cgminer-sha2.o
  CC     cgminer-api.o
api.c: In function ‘print_data’:
api.c:1104: warning: format ‘%06ld’ expects type ‘long int’, but argument 6 has type ‘__darwin_suseconds_t’
  CC     cgminer-logging.o
  CC     cgminer-driver-opencl.o
  CC     cgminer-ocl.o
  CC     cgminer-findnonce.o
  CC     cgminer-adl.o
  CC     cgminer-scrypt.o
  CCLD   cgminer
Undefined symbols for architecture x86_64:
  "_curl_easy_cleanup", referenced from:
      _update_gbt in cgminer-cgminer.o
      _pool_active in cgminer-cgminer.o
      _longpoll_thread in cgminer-cgminer.o
      _reap_curl in cgminer-cgminer.o
      _setup_stratum_curl in cgminer-util.o
      _suspend_stratum in cgminer-util.o
  "_curl_easy_getinfo", referenced from:
      _json_rpc_call in cgminer-util.o
      _setup_stratum_curl in cgminer-util.o
  "_curl_easy_init", referenced from:
      _update_gbt in cgminer-cgminer.o
      _recruit_curl in cgminer-cgminer.o
      _pool_active in cgminer-cgminer.o
      _longpoll_thread in cgminer-cgminer.o
      _setup_stratum_curl in cgminer-util.o
  "_curl_easy_perform", referenced from:
      _json_rpc_call in cgminer-util.o
      _setup_stratum_curl in cgminer-util.o
  "_curl_easy_reset", referenced from:
      _json_rpc_call in cgminer-util.o
  "_curl_easy_setopt", referenced from:
      _longpoll_thread in cgminer-cgminer.o
      _keep_curlalive in cgminer-util.o
      _json_rpc_call in cgminer-util.o
      _setup_stratum_curl in cgminer-util.o
  "_curl_global_cleanup", referenced from:
      _clean_up in cgminer-cgminer.o
  "_curl_global_init", referenced from:
      _main in cgminer-cgminer.o
  "_curl_slist_append", referenced from:
      _json_rpc_call in cgminer-util.o
  "_curl_slist_free_all", referenced from:
      _json_rpc_call in cgminer-util.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [cgminer] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

从我阅读的所有内容来看,这是某种类型的链接器错误,而不是编译错误。这显示在./configure脚本的末尾:
------------------------------------------------------------------------
cgminer 3.0.0
------------------------------------------------------------------------


Configuration Options Summary:

  curses.TUI...........: FOUND: -lncurses
  OpenCL...............: FOUND. GPU mining support enabled
  scrypt...............: Enabled
  ADL..................: SDK NOT found, GPU monitoring support DISABLED

  Avalon.ASICs.........: Disabled
  BFL.ASICs............: Disabled
  BitForce.FPGAs.......: Disabled
  Icarus.FPGAs.........: Disabled
  ModMiner.FPGAs.......: Disabled
  Ztex.FPGAs...........: Disabled

Compilation............: make (or gmake)
  CPPFLAGS.............: -I/usr/local/opt/curl/include
  CFLAGS...............: -g
  LDFLAGS..............: -L/usr/local/opt/curl/lib
  LDADD................:  -L/usr/local/opt/curl/lib -ljansson -lpthread -framework OpenCL    -lm

Installation...........: make install (as root if needed, with 'su' or 'sudo')
  prefix...............: /usr/local

我不知道如何解决链接器错误。我需要更改我的./configure吗?任何建议,不胜感激。

最佳答案

这似乎可行:

关于compiler-errors - 在这种情况下,如何修复体系结构x86_64的 undefined symbol ?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16247276/

10-14 10:48