kripken/emscripten — Issue #306: Converted Static Libraries do not include Library Functions
Author: manuels
Created: 2012-03-08 23:38:54+00:00
State: open

If you store this as calc_mean.c:

double mean(double a, double b) {
return (a+b) / 2;
}

and compile it
`clang -c calc_mean.c -o calc_mean.o -emit-llvm`

then create a static library:
`ar rcu libmean.a calc_mean.o`

(check symbols:)
`llvm-nm libmean.a`
`llvm-nm calc_mean.o`

convert to js:
`emcc -O0 --closure 0 libmean.a`

resulted js code does not include the mean function (even when adding 'mean' and '_mean' to EXPORTED_FUNCTIONS)