View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000332 | mercury | Bug | public | 2014-06-07 03:18 | 2014-07-10 14:06 | ||||
Reporter | lpimmes | ||||||||
Assigned To | |||||||||
Priority | urgent | Severity | major | Reproducibility | always | ||||
Status | closed | Resolution | no change required | ||||||
Platform | OSX | OS | 10.9 | OS Version | |||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000332: Cannot find symbols in lpiUtil.jar | ||||||||
Description | #Problem: compiling formalLang_lib.m with ../lpiUtil/lpiUtil.m in the JAVA grade. # formalLang.m, a wrapper around formalLang_lib.m, and lpiUtil.m is working fine. # We have a similar Makefile for building mercury code-- working immediately below: #formalLang 548>./formalLang aabb #A^nB^n --> aabb #formalLang 548>./formalLang aab #Failed to parse input sentence. # We need to tell javac about the Mercury libraries. UTILPATH = ../lpiUtil #lpiUtil 527>mmc --make -s java liblpiUtil # creates # lpiUtil.jar See steps below to reproduce. Thanks for your time. | ||||||||
Steps To Reproduce | Part of a larger makefile: Makefile_formalLang_lib_jar (see attached). formalLang 549>make -f Makefile_formalLang_lib_jar libformalLang_lib.jar mmc --grade java --make libformalLang_lib \ --search-lib-files-dir . \ --init-file formalLang_lib.init \ --link-object libformalLang_lib.a \ --search-lib-files-dir ../lpiUtil \ --link-object ../lpiUtil/liblpiUtil.a \ --init-file ../lpiUtil/lpiUtil.init Making Mercury/javas/jmercury/formalLang_lib.java Making Java class files Mercury/javas/jmercury/formalLang_lib.java:436: error: cannot find symbol InputLst_5 = lpiUtil.strToLst_2_p_0(InputStr_3); ^ symbol: variable lpiUtil location: class formalLang_lib Mercury/javas/jmercury/formalLang_lib.java:443: error: cannot find symbol java.lang.Object [] result = lpiUtil.oneOrMoreLst_4_p_0(V_31_31, InputLst_5); ^ | ||||||||
Additional Information | # How to get lpiUtil.jar included in this part? # Or do I just use the *.a and *.init files from mercury? | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
wangp (developer) 2014-06-15 12:19 |
The error is because the Java compiler cannot find lpiUtil. You may need to use the mmc --java-classpath option. Use mmc -v to see the actual javac command. I don't understand why you are trying to link with a .a file, which (normally) contains native code. |
lpimmes (reporter) 2014-07-06 02:05 |
You were correct, --java-classpath $CLASSPATH and -v option solved the problem; no need for native code (.a). Thanks; working code below: formalLang 507>make -f Makefile_formalLang_lib_jar ... formalLang 507>./mercury_main In Mercury main, about to call java_main... In java_main()... abc, one_parse() gives value = A^nB^nC^n --> abc ab, one_parse() gives value = A^nB^n --> ab b, one_parse() gives value = Failed to parse input sentence. a, one_parse() gives value = Failed to parse input sentence. aabb, one_parse() gives value = A^nB^n --> aabb aaabb, one_parse() gives value = Failed to parse input sentence. aaaabbb, one_parse() gives value = Failed to parse input sentence. aaabbb, one_parse() gives value = A^nB^n --> aaabbb aaabb, one_parse() gives value = Failed to parse input sentence. Returning from java_main() Back in Mercury main. formalLang 507> |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-06-07 03:18 | lpimmes | New Issue | |
2014-06-07 03:18 | lpimmes | File Added: Makefile_formalLang_lib_jar | |
2014-06-15 12:19 | wangp | Note Added: 0000699 | |
2014-07-06 02:05 | lpimmes | Note Added: 0000736 | |
2014-07-10 14:06 | wangp | Status | new => closed |
2014-07-10 14:06 | wangp | Resolution | open => no change required |