Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Tips for compiling on OSX #2

prathe opened this Issue Jun 21, 2012 · 5 comments


None yet
2 participants

prathe commented Jun 21, 2012


I have errors while compiling.

$ make
Making build dir
gcc -o  build/luabash.so src/luabash.c -llua -shared -fPIC -Wall    
Undefined symbols for architecture x86_64:
    "_find_variable", referenced from:
            _getvar in ccCCkpAU.o
    "_make_word", referenced from:
            _register_function in ccCCkpAU.o
            _call_bashfunction in ccCCkpAU.o
    "_make_command", referenced from:
            _register_function in ccCCkpAU.o
            _call_bashfunction in ccCCkpAU.o
    "_bind_function", referenced from:
            _register_function in ccCCkpAU.o
    "_bind_variable", referenced from:
            _set_variable in ccCCkpAU.o
    "_execute_command", referenced from:
            _call_bashfunction in ccCCkpAU.o
    "_all_shell_variables", referenced from:
            _get_environment in ccCCkpAU.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [build] Error 1

I've tried with llvm-gcc-4.2 and gcc-4.2 but I got the same error. I'm on OSX Lion with XCode 4.3.2 installed.

Any idea? I'm very excited to try it... :D

@ghost ghost assigned masterkorp Jun 22, 2012


masterkorp commented Jun 22, 2012

I am going to check it on the weekend


masterkorp commented Jun 23, 2012

Can you give me both your bash and lua versions? And if possible the comiple flags?

prathe commented Jun 23, 2012

$ lua
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio

I tried both bash and zsh


zsh 4.3.11 (i386-apple-darwin11.0)


GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)
Copyright (C) 2007 Free Software Foundation, Inc.

Which compile flags are you talking about? Luabash? gcc?

By the way have you tried to submit your project to Lua Dist?
It is a package manager and central repository for Lua modules.

I am not a pro of compilation. I could try to search more intensely, don't lose to much time on it. Maybe porting your Makefile to be include in Lua Dist with their help is a better investment?

Thanks anyway.


masterkorp commented Jun 26, 2012

Hello, this is not a lua module, but a bash command that uses the lua C api to comunitcate. Its the only way possible to do it. I think that your bash was compiled with some strange params, are those the mac osx defauls?


masterkorp commented Jun 26, 2012

So aparently there is no chance to check that. And since your bash is really old, you should just upgrade. You can use Homebrew http://mxcl.github.com/homebrew/ and use their bash package https://github.com/mxcl/homebrew/blob/master/Library/Formula/bash.rb

@masterkorp masterkorp closed this Jun 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment