How to use dialyzer with parse transform modules

最后都变了- 提交于 2019-12-12 00:44:48

问题


I'm trying to use dialyzer on my erlang application but here's the output :

dialyzer \
        --src -r src \
        -pa /home/niahoo/src/popos \
        -pa /home/niahoo/src/popos/deps/parse_trans \
        --verbose
  Checking whether the PLT c:/MinGW/msys/1.0/home/niahoo/.dialyzer_plt is up-to-date... yes
  Proceeding with analysis...
dialyzer: Analysis failed with error:
Could not scan the following file(s): [{"c:/MinGW/msys/1.0/home/niahoo/src/popos/src/tools/r.erl",
                                        ["c:/MinGW/msys/1.0/home/niahoo/src/popos/src/tools/r.erl:none: undefined parse transform 'exprecs'\n"]},
                                       {"c:/MinGW/msys/1.0/home/niahoo/src/popos/src/game/party2.erl",
                                        ["c:/MinGW/msys/1.0/home/niahoo/src/popos/src/game/party2.erl:none: undefined parse transform 'playerdupli'\n"]}]
Last messages in the log cache:
  Reading files and computing callgraph... 

I tried to put playerdupli.erl in the same directory as party2.erl, but the output is the same. exprecs.erl is in the deps: deps/parse_trans/src.

The code compiles and runs without error, including parse_transform stuff. I'm on MinGW (Windows 8 64). Any idea ?

Thanks


回答1:


An alternative that is always easier, is to compile with +debug_info and let dialyzer analyze the resulting .beam files.




回答2:


So, i should have missed something in the doc. There is the command that works :

dialyzer \
    --src -r src \
    -pa /home/niahoo/src/popos \
    -pa ebin \
    -pa deps/parse_trans/ebin \
    --raw \
    --statistics \

-pa /home/niahoo/src/popos Allows dilayzer to find included .hrl used with include_lib -pa ebin allows to find my parse_transform module (playerdupli) -pa deps/parse_trans/ebin idem. with exprecs



来源:https://stackoverflow.com/questions/16723253/how-to-use-dialyzer-with-parse-transform-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!