linux - Possible cause for "Can't resolve symbol"? -


the cross-compiling of lua, test module, , real-life module went ok, when load real-life module on appliance running uclinux, error:

appliance::/var/tmp> ./lua -l dummy hello dummy bye dummy lua 5.1.4  copyright (c) 1994-2008 lua.org, puc-rio  appliance::/var/tmp> ./lua -l luasql.sqlite3 ./lua: can't resolve symbol '_lual_ref' 

i don't have enough experience know cause is, although google seems point issues shared libraries. maybe module expects library, or specific version of library , it's not there?

has seen type of error before? how investigate?

thank you.


edit: here config/makefiles used build lua, sqlite3, , luasql sqlite3:

# cat /var/tmp/lua-5.1.4/src/makefile mycflags= myldflags= mylibs=  export path:=$(path):/usr/src/baps/opt/uclinux/bfin-linux-uclibc/bin  target_cross=bfin-linux-uclibc- export cc=$(target_cross)gcc export strip=$(target_cross)strip export ar=$(target_cross)ar rcu export ranlib=$(target_cross)ranlib export staging_dir=/usr/src/baps/uclinux-dist/staging export uclinux_lib=/usr/src/baps/uclinux-dist/lib export uclinux_root_lib=/usr/src/baps/uclinux-dist/root/lib export cflags=-o2 -wall -wmissing-prototypes -wmissing-declarations -i$(staging_dir)/usr/include -dlua_use_posix -dlua_use_dlopen export ldflags= -l$(staging_dir)/usr/lib -l$(uclinux_lib) -l$(uclinux_root_lib) -ldl -lm  ... $(lua_t): $(lua_o) $(lua_a)         $(cc) -o $@ $(cflags) $(ldflags) $(lua_o) $(lua_a)  $(luac_t): $(luac_o) $(lua_a)         $(cc) -o $@ $(cflags) $(ldflags) $(luac_o) $(lua_a) ... generic:         $(make)  # cat /var/tmp/sqlite-amalgamation-3070400/makefile export path:=$(path):/usr/src/baps/opt/uclinux/bfin-linux-uclibc/bin  target_cross=bfin-linux-uclibc- export cc=$(target_cross)gcc export strip=$(target_cross)strip export ar=$(target_cross)ar rcu export ranlib=$(target_cross)ranlib export cflags=-o2 -wall  libsqlite3.o:         $(cc) $(cflags) -dsqlite_threadsafe=0 -o $@ -c sqlite3.c  # cat /var/tmp/luasql-2.1.1/config ... lua_inc= /var/tmp/lua-5.1.4/src lib_option= -shared #for linux ... driver_libs= /var/tmp/sqlite-amalgamation-3070400/libsqlite3.o driver_incs= -i/var/tmp/sqlite-amalgamation-3070400  warn= -wall incs= -i$(lua_inc) cflags= -o2 $(warn) -i$(compat_dir) $(driver_incs) $(incs) $(defs) cc=/usr/src/baps/opt/uclinux/bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ldflags = -wl,--trace,--print-map,--cref  # cat /var/tmp/luasql-2.1.1/makefile ... src/$(libname): $(objs)         $(cc) $(cflags) $(ldflags) -o $@ $(objs) $(driver_libs) $(lib_option) 

edit: after being told linking issue, , after more reading , trial/error, found was: when building lua, following options required: "-wl,-e"

i don't have experience lua, in general can when symbol "unresolved", indication linker cannot find symbol in of archive files or libraries told link together. need identify library defines symbol , include in link command, -l flag. may need provide -l flag giving directory includes library. in makefile, add these flags ldflags variable.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -