Skip to content

Instantly share code, notes, and snippets.

@iwadon
Created May 15, 2012 09:29
Show Gist options
  • Save iwadon/2700367 to your computer and use it in GitHub Desktop.
Save iwadon/2700367 to your computer and use it in GitHub Desktop.
sometimes mrblib.o is not merged into libmruby.a
imac:~/src/mruby% rm lib/libmruby.a
imac:~/src/mruby% rm mrblib/mrblib.o
imac:~/src/mruby% make
ar r ../lib/libmruby.a ./array.o ./ascii.o ./cdump.o ./class.o ./codegen.o ./compar.o ./crc.o ./dump.o ./encoding.o ./enum.o ./error.o ./etc.o ./gc.o ./hash.o ./init.o ./init_ext.o ./kernel.o ./load.o ./math.o ./numeric.o ./object.o ./pool.o ./print.o ./proc.o ./range.o ./re.o ./regcomp.o ./regenc.o ./regerror.o ./regexec.o ./regparse.o ./sprintf.o ./st.o ./state.o ./string.o ./struct.o ./symbol.o ./time.o ./transcode.o ./unicode.o ./us_ascii.o ./utf_8.o ./variable.o ./version.o ./vm.o ./y.tab.o
ar: creating archive ../lib/libmruby.a
gcc -Wall -Werror-implicit-function-declaration -g -O3 -MMD -I../src -I../include -c mrblib.c -o mrblib.o
gcc -o ../../bin/mruby -g -O3 ../../src/../tools/mruby/mruby.o ../../lib/libmruby.a -lm
Undefined symbols for architecture x86_64:
"_mrb_init_mrblib", referenced from:
_mrb_init_core in libmruby.a(init.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../bin/mruby] Error 1
make: *** [all] Error 2
[1] 6912 exit 2 make
imac:~/src/mruby% rm mrblib/mrblib.o
imac:~/src/mruby% make
make[1]: Nothing to be done for `all'.
gcc -Wall -Werror-implicit-function-declaration -g -O3 -MMD -I../src -I../include -c mrblib.c -o mrblib.o
ar r ../lib/libmruby.a mrblib.o
gcc -o ../../bin/mruby -g -O3 ../../src/../tools/mruby/mruby.o ../../lib/libmruby.a -lm
gcc -o ../../bin/mirb -g -O3 ../../src/../tools/mirb/mirb.o ../../lib/libmruby.a -lm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment