我在我的项目上执行cabal run时遇到了问题。这个项目以前可以正常运行,我不确定是什么改变导致了它的崩溃。我认为这可能与GHC 7.6和OSX Mavericks之间的问题有关(我在这里使用Darin Morrison的homebrew配方)。[编辑:澄清一下,这在Mavericks上曾经可以工作,所以这个假设可能不成立。]问题似乎出现在链接步骤中:
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
所有这些符号都来自我的项目(根据名称判断)。我看到的大多数答案都与某个库没有正确链接有关。我怀疑一些符号是由Data.Aeson.TH
中的deriveToJSON
生成的。我已经重新安装了几次,但没有解决。有什么想法吗?