main.xc:
Code: Select all
#include "functions.h"
int main(void) {
chan c;
par {
send(c);
receive(c);
}
return 0;
}
Code: Select all
void send(chanend c);
void receive(chanend c);
Code: Select all
#include <xccompat.h>
#include "channels.h"
void send(chanend c) {
while(1) {
chanOut(c, 0);
}
}
void receive(chanend c) {
while(1) {
chanIn(c);
}
}
Code: Select all
void chanOut(chanend c, unsigned v);
void chanIn(chanend c);
Code: Select all
#include "channels.h"
void chanOut(chanend c, unsigned v) {
c <: v;
}
void chanIn(chanend c) {
unsigned v;
c :> v;
}
Code: Select all
xcc -target=XC-1 -c channels.xc
xcc -target=XC-1 -c main.xc
xcc -target=XC-1 -std=c++98 -c functions.cpp
xcc -target=XC-1 main.o functions.o channels.o
Code: Select all
xmap: Error: Value of undefined resource symbol "send.nstackwords" cannot be determined.
xmap: Error: Symbol "send.nstackwords" for resolution of resource expression for ".LLNK6" is undefined.
Code: Select all
functions.cpp: Error: Undefined reference to '_Z6chanInj'
functions.cpp: Error: Undefined reference to '_Z7chanOutjj'