I'm assuming your main program and the package are in the same directory, correct? if that is the case then it should work by default without having to set IPATH and LAPTH. if it doesn't then we ay have a bug. Set your Unicon's environment variables IPATH and LPATH to include the current directory and try to compoile your main program again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Jafar, yes correct, all my files are in the same directory.
First I did:
unicon String.icn
followed by:
packagetest.icn
and get the following:
D:\Dev\Unicon>unicon String.icn
Parsing String.icn: String.icn is already in Package string
..split is already in Package string
d:\apps\Unicon\bin\icont.exe -c -O String.icn C:\Users\NV7547\AppData\Local\Temp\uni13967197
Translating:
String.icn:
string__split
No errors
d:\apps\Unicon\bin\icont.exe String.u
Linking:
D:\Dev\Unicon>unicon packagetest.icn
Parsing strings.icn: ...
d:\apps\Unicon\bin\icont.exe -c -O packagetest.icn C:\Users\NV7547\AppData\Local\Temp\uni18337549
Translating:
packagetest.icn:
sum
main
No errors
d:\apps\Unicon\bin\icont.exe packagetest.u
Linking:
icont: cannot resolve reference to file 'D:/Dev/Unicon/String.u'
I am usually on Linux. But for the while being Im on Windows 10. Its been a while since using Windows...Could you jog my memory on how to set path vars in Windows?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Would it be possible to share abit more on how to properly create and use packages?
For example I have created a file String.icn with package definition:
What are the steps to import this into a program? I have compiled it first, then compiled my main program which has:
import String
However I get an error that the package doesnt exist.
Any tips would be great.
Regards
I'm assuming your main program and the package are in the same directory, correct? if that is the case then it should work by default without having to set IPATH and LAPTH. if it doesn't then we ay have a bug. Set your Unicon's environment variables IPATH and LPATH to include the current directory and try to compoile your main program again.
Jafar, yes correct, all my files are in the same directory.
First I did:
unicon String.icn
followed by:
packagetest.icn
and get the following:
I am usually on Linux. But for the while being Im on Windows 10. Its been a while since using Windows...Could you jog my memory on how to set path vars in Windows?
I will give that a test when I get a chance.
to set the two variable on windows do
set IPATH=.
set LPATH=.
and then continue your commands
Yves,
Just noticed! you compiled your package file with
and not
The first command without the -c will produce an executable, not a link-able module/package. That is why you get :
The file isn't there! :)
Last edit: Jafar 2019-08-26
Jafar, uncon -c did the trick! That was the issue.