2012. 3. 18.

erlang compile with other module.

If you make your own modules.  You want to use them.
You can use 'import' command as you expected.

-import(modulename, function_name).

but sometimes you will meet  'some errors'.

If your code is as below.


 -import(mod1, [get/1]).

When you compile, you will meet error


 import directive overrides pre R14 auto-imported BIF get/1
 - use "-compile({no_auto_import,[get/1]})." to resolve name clash 

Yes, you muse add  line 

-compile({no_auto_import,[get/1]}).
 -import(mod1, [get/1]).


댓글 없음:

댓글 쓰기