lotus



previous page: C11.1.2) Computed remotes and virtuals
  
page up: BETA Programming Language FAQ
  
next page: C11.1.4) Reference assignment of repetitions

C11.1.3) "T1PROGRAM undefined" reported by the linker




Description

This article is from the FAQ, by with numerous contributions by others.

C11.1.3) "T1PROGRAM undefined" reported by the linker

As explained in section 7.3 "Assembler and Linker Errors" in the compiler
reference manual [MIA 90-02], if an unbound SLOT of category Descriptor or
Dopart exist in your program, then this is currently not reported by the
compiler itself, but will be detected as an "Undefined Entry" by the linker.
Especially if you are new to BETA programming, you may wonder why compiling
this fragment (foolib.bet):

   ORIGIN '~beta/basiclib/current/betaenv';
   --- lib: attributes ---
   foo: (# (* ... *) #);

with "beta foolib" causes the linker error "T1PROGRAM undefined". In this
case the reason is that the fragment is actually a library fragment - it
only declares attributes to be used by some program. Specifically the
PROGRAM descriptor SLOT defined in "betaenv" has not been bound, and thus
the error.

The solution is quite simple: Just compile the program as "beta -c foolib"
instead. The next version of the BETA compiler will not attempt to do the
linking if the PROGRAM SLOT is not bound.

If you think this is strange, compare to the equivalent situation in C
(foolib.c)

foo() { /* ... */ }

If you compile this file with e.g. "cc foolib.c", you will often get the
linker error that "_main" is not defined. The solution here is like in BETA:
"cc -c foolib.c"

Version v5.1 of the compiler may under rare conditions exhibit the above
behaviour, in which case you should use the above workaround, except the the
compiler switch -c in v5.1 have been renamed to -x.

 

Continue to:















TOP
previous page: C11.1.2) Computed remotes and virtuals
  
page up: BETA Programming Language FAQ
  
next page: C11.1.4) Reference assignment of repetitions