Compiler construction 交叉编译unixODBC的问题

Compiler construction 交叉编译unixODBC的问题,compiler-construction,arm,cross-compiling,libtool,unixodbc,Compiler Construction,Arm,Cross Compiling,Libtool,Unixodbc,我在Mac上,当我试图为arm7编译unixODBC以便在iOS中使用时,我遇到了libtool链接问题。我下载并使用以下脚本对其进行配置和制作 #!/bin/sh # unset some shell variables unset CC unset CFLAGS unset CPP # make arm target export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Devel

我在Mac上,当我试图为arm7编译unixODBC以便在iOS中使用时,我遇到了libtool链接问题。我下载并使用以下脚本对其进行配置和制作

#!/bin/sh

# unset some shell variables
unset CC
unset CFLAGS
unset CPP

# make arm target
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2
export CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk"
export CPP=/usr/bin/cpp

./configure --build=x86_64-apple-darwin12 --host=arm-apple-darwin10 --target=armv7 --enable-static --disable-shared

make all
./configure运行正常,但在make期间,它会中断。我得到以下错误:

Undefined symbols for architecture armv7:
  "_lt_libltdlc_LTX_preloaded_symbols", referenced from:
      _lt_dlinit in libodbc.a(libltdlc_la-ltdl.o)
ld: symbol(s) not found for architecture armv7
我将错误范围缩小到在exe目录中运行makeall时,特别是在运行以下命令时

/bin/sh ../libtool --tag=CC --mode=link /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -pthread -o isql isql.o ../DriverManager/libodbc.la ../extras/libodbcextraslc.la  
我不太清楚它为什么会失败。我已经检查了lt_dlinit函数是否存在,从我所知道的情况来看,一切都做得很正确。然而,我使用libtool的经验是不存在的,我处理链接器问题的经验也不广泛

非常感谢您的帮助,如有必要,我可以提供任何其他信息。提前谢谢你

也许值得一试

libtoolize-copy-ltdl


在unixODBC构建树的根目录下,复制到本地版本的libtool中

感谢您的帮助。但那没用。我在运行脚本之前运行了它,但是当makeall启动时,我得到了以下错误:libtool:versionmismatch错误。这是libtool 2.4.2,但是这个LT_INIT的定义来自libtool 2.2.6b。您应该使用libtool 2.4.2中的宏重新创建aclocal.m4,然后再次运行autoconf。还有其他建议吗?再次感谢!当我必须使用自动工具在Mac上构建东西时,我通常只安装最新的稳定GNU自动工具。通常,与特定版本的OS X一起安装的自动工具过于古老,无法在该版本的OS X上实际使用,尤其是GNU libtool,它似乎有一定的规律性。