我在我的项目上运行 cabal 时遇到问题。这个项目曾经正常运行,我不完全确定是什么改变破坏了它。我认为这与GHC 7.6 和 OSX Mavericks之间的问题有关(我在这里使用的是 Darin Morrison 的自制公式)。[编辑:澄清一下,这在小牛队的某个时候起作用,所以这个假设可能不成立。]问题似乎出在链接步骤中:
In-place registering chorez-0.1.0.0...
Preprocessing executable 'chorez' for chorez-0.1.0.0...
Linking dist/build/chorez/chorez ...
Undefined symbols for architecture x86_64:
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_AddResponse_con_info", referenced from:
_s5X4_info in libHSchorez-0.1.0.0.a(Commands.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_ErrorResponse_static_info", referenced from:
_chorezzzm0zi1zi0zi0_ChorezzziCommands_route1_closure in libHSchorez-0.1.0.0.a(Commands.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_parseRequest_closure", referenced from:
_r7eV_srt in libHSchorez-0.1.0.0.a(Server.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_parseRequest_info", referenced from:
_s7nh_info in libHSchorez-0.1.0.0.a(Server.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_zdfToJSONResponse1_closure", referenced from:
_r7eS_closure in libHSchorez-0.1.0.0.a(Server.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_zdfToJSONResponse4_closure", referenced from:
_s7ng_info in libHSchorez-0.1.0.0.a(Server.o)
_r7eQ_closure in libHSchorez-0.1.0.0.a(Server.o)
_r7eV_srt in libHSchorez-0.1.0.0.a(Server.o)
"_chorezzzm0zi1zi0zi0_ChorezzziRequest_zdfToJSONResponse5_closure", referenced from:
_s7ng_info in libHSchorez-0.1.0.0.a(Server.o)
_r7eV_srt in libHSchorez-0.1.0.0.a(Server.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
所有这些符号都来自我自己的项目(从名称来看)。我看到的关于此问题的大多数答案都与某个未正确链接的库有关。我怀疑其中一些符号是由deriveToJSON
from生成的Data.Aeson.TH
。我重装了几次都没有解决。有任何想法吗?