1

I am doing a little programming exercise in Modula2. I am using the gm2 compiler on Ubuntu Linux (10.04).

I have gotten some code to compile but I am unable to import certain modules which, to my understanding, should be included in the compiler distribution. For example, if I try to import from the TimeDate module

FROM TimeDate IMPORT Time, GetTime;

which is documented here, I get the error:

$ gm2 -flibs=pim -c SortUtil.mod

failed to find definition module TimeDate.def

According to the documentation, the option -flibs=pim should give access to the TimeDate module (which is part of the PIM libraries).

Does anyone have any experience with this compiler? Do I need some extra command-line parameters or do I need to install some extra packages?

Giorgio
  • 5,023
  • 6
  • 41
  • 71
  • Have you verified that TimeDate.def exists on your filesystem? If so, where is it located in relation to other modules that you can import? – Brian Knoblauch Feb 29 '12 at 14:59
  • Actually, I cannot find any .def file for library modules I can import. For example, I can compile 'FROM StrIO IMPORT WriteString, WriteLn;', but there is no StrIO.def on my filesystem (I guess the declaration is contained in some other installed file). There is no 'TimeDate.def' file either. For modules I have written myself I have to provide such a file (and it works). – Giorgio Feb 29 '12 at 18:51
  • 1
    So it seems to me that there are: (1) library modules that can be imported even though there is no .def file for them, (2) library modules without a .def file that cannot be imported, and (3) self-written modules with .def file that can be imported. For (2) I guess I either need to install some extra package or I need to use some compiler switches. I am still looking in the documentation to see if I can find some information on this. – Giorgio Feb 29 '12 at 18:54
  • I have installed the compiler following the instructions I found at http://www.nongnu.org/gm2/debian.html – Giorgio Feb 29 '12 at 18:58
  • Afraid to say that all my Modula-2 experience has been with DOS and Windows compilers. Not familiar with the GNU compiler. :-( – Brian Knoblauch Feb 29 '12 at 20:45
  • I had also worked with Modula-2 on MSDOS but it is a while ago. Thanks for the hints anyway. – Giorgio Mar 01 '12 at 21:04
  • @Brian Knoblauch: Did you use Modula-2 professionally? I used it a bit during my study. I am trying to implement some algorithms with it right now, to see how it works. – Giorgio Apr 11 '12 at 11:35
  • Unfortunately I've never had the opportunity to use it in a truly professional capacity. I used it at home a bit back in the DOS days (up through the OS/2 and early Windows days). I found it well suited to larger projects I was doing (for fun) back then. I really haven't had any time for "fun"/home projects in quite awhile though, so my Modula-2 is rusty. Luckily I found a couple simple utilities I could use it for at work (and I found out about the ADW compiler for Windows being released as freeware), so I've been able to get back to it a little bit. – Brian Knoblauch Apr 11 '12 at 11:39

1 Answers1

1

I set up a test system and was able to duplicate your problem. Use "-flibs=pim,logitech"... That worked for me and let me compile a basic test app without throwing the error about a missing definition file.

Brian Knoblauch
  • 20,639
  • 15
  • 57
  • 92