ChorusOS 4.0 Production Guide

Linking your Application to the Library

To link the hello actor to the new ciao.a library, the hello.bf file, in your MYCOMP/src directory, must be modified to contain the following information:

 C__SRCS = hello.c
    LIBS = ciao/ciao.a $(OS_DIR)/lib/classix/libcx.a \
    $(NUCLEUS_DIR)/lib/classix/libsys.s.a
    Actor(hello, $(LIBS))
    Export(hello, $(MYCOMP_DIR)/root/bin)

Rebuild the Makefiles and the hello actor as follows:

host% make makemk
host% make
 ...
 cc bye.c
 Makefile -> all.dp
 ar -> ciao.a
 ...
 sh /<work_dir>/build-DEVTOOLS/host/bin//../../tgt-make/genLink \
 /<work_dir>build-NUCLEUS/ /<work_dir> -r -e _start -o hello -B ciao/ciao.a \
 /<work_dir>/build-OS/lib/classix/libcx.a \
 /<work_dir>/build-NUCLEUS/lib/classix/libsys.s.a
 ld -> hello.xpO
 hello.xpO -> hello.CT.o
 export hello
 << In src link done