Skip to content

Instantly share code, notes, and snippets.

@tpimh
Created April 5, 2016 17:36
Show Gist options
  • Save tpimh/9083e6ccf6d35803fd5dc4e834157381 to your computer and use it in GitHub Desktop.
Save tpimh/9083e6ccf6d35803fd5dc4e834157381 to your computer and use it in GitHub Desktop.
valac -o test first.vala second.vala main.vala
# OR
valac -C first.vala --internal-vapi=first.vapi --header=first.h --internal-header=first_internal.h
valac -C second.vala --vapidir=. --pkg first --internal-vapi=second.vapi --header=second.h --internal-header=second_internal.h
valac -C main.vala --vapidir=. --pkg first --pkg second --internal-vapi=main.vapi --header=main.h --internal-header=main_internal.h
gcc -c $CFLAGS -I. first.c
gcc -c $CFLAGS -I. second.c
gcc -c $CFLAGS -I. main.c
gcc -o test $LDFLAGS first.o second.o main.o
class First {
public int a() {
return 4;
}
}
void main() {
Second s = new Second(new First());
s.p();
}
class Second {
private First f;
public Second(First f) {
this.f = f;
}
public void p() {
print(@"$(f.a())\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment