我在机器上安装了带有Linux-Realtime的NI硬件cRIO 9068。据我所知,它是使用opkg包管理器的嵌入式Linux版本。在这种情况下,我需要一些opkg上没有的软件。
我一直在尝试编译freeTDS和unixODBC驱动程序的源代码,以便在Linux系统中与Microsoft SQL Server通信。但是,当遵循典型的./configure进行设置时,我会收到unixODBC的错误:
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) awk
checking for bison... bison -y
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/admin/sqlFiles/unixODBC-2.3.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
的config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by unixODBC configure 2.3.2-pre, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = NI-cRIO-9068-193EAD1
uname -m = armv7l
uname -r = 3.2.35-rt52-2.0.0f0
uname -s = Linux
uname -v = #1 SMP PREEMPT RT Tue Jun 3 20:49:19 CDT 2014
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/natinst/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2623: checking for a BSD-compatible install
configure:2691: result: ./install-sh -c
configure:2702: checking whether build environment is sane
configure:2752: result: yes
configure:2893: checking for a thread-safe mkdir -p
configure:2932: result: ./install-sh -c -d
configure:2945: checking for gawk
configure:2975: result: no
configure:2945: checking for mawk
configure:2975: result: no
configure:2945: checking for nawk
configure:2975: result: no
configure:2945: checking for awk
configure:2961: found /usr/bin/awk
configure:2972: result: awk
configure:2983: checking whether make sets $(MAKE)
configure:3005: result: yes
configure:3090: checking for gawk
configure:3117: result: awk
configure:3132: checking for bison
configure:3148: found /usr/bin/bison
configure:3159: result: bison -y
configure:3183: checking for style of include used by make
configure:3211: result: GNU
configure:3282: checking for gcc
configure:3298: found /usr/bin/gcc
configure:3309: result: gcc
configure:3538: checking for C compiler version
configure:3547: gcc --version >&5
gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3558: $? = 0
configure:3547: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/gcc/arm-nilrt-linux-gnueabi/4.7.2/lto-wrapper
Target: arm-nilrt-linux-gnueabi
Configured with: /home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/work-shared/gcc-4.7.2-r20/gcc-4.7.2/configure --build=x86_64-linux --host=arm-nilrt-linux-gnueabi --target=arm-nilrt-linux-gnueabi --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib/gcc --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-nilrt-linux-gnueabi- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --with-sysroot=/ --with-build-sysroot=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq --with-native-system-header-dir=/home/labview_rt/dev/perforce/ThirdPartyExports/NIOpenEmbedded/trunk/2.0/objects/zynq/linuxU/armv7-a/gcc-4.7-oe/release/build/tmp-eglibc/sysroots/xilinx-zynq/usr/include --with-gxx-include-dir=/usr/include/c++/ --enable-nls
Thread model: posix
gcc version 4.7.2 (GCC)
configure:3558: $? = 0
configure:3547: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3558: $? = 1
configure:3547: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3558: $? = 1
configure:3578: checking whether the C compiler works
configure:3600: gcc conftest.c >&5
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
configure:3604: $? = 1
configure:3642: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "unixODBC"
| #define PACKAGE_TARNAME "unixodbc"
| #define PACKAGE_VERSION "2.3.2-pre"
| #define PACKAGE_STRING "unixODBC 2.3.2-pre"
| #define PACKAGE_BUGREPORT "nick@unixodbc.org "
| #define PACKAGE_URL ""
| #define PACKAGE "unixODBC"
| #define VERSION "2.3.2"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3647: error: in `/home/admin/sqlFiles/unixODBC-2.3.2':
configure:3649: error: C compiler cannot create executables
See `config.log' for more details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_prog_AWK=awk
ac_cv_prog_YACC='bison -y'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run aclocal-1.11'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AR=''
ARGZ_H=''
AS=''
AUTOCONF='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run autoconf'
AUTOHEADER='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run autoheader'
AUTOMAKE='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run automake-1.11'
AWK='awk'
BIN_PREFIX=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CONVENIENCE_LTDL_FALSE=''
CONVENIENCE_LTDL_TRUE=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFLIB_PATH=''
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
DRIVERC_FALSE=''
DRIVERC_TRUE=''
DRIVERS_FALSE=''
DRIVERS_TRUE=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEC_PREFIX=''
EXEEXT=''
FGREP=''
GREP=''
HAVE_FLEX_FALSE=''
HAVE_FLEX_TRUE=''
ICONV_CHAR_ENCODING=''
ICONV_UNICODE_ENCODING=''
INCLTDL=''
INCLUDE_PREFIX=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_LTDL_FALSE=''
INSTALL_LTDL_TRUE=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LFLAGS=''
LIBADD_CRYPT=''
LIBADD_DL=''
LIBADD_DLD_LINK=''
LIBADD_DLOPEN=''
LIBADD_POW=''
LIBADD_SHL_LOAD=''
LIBICONV=''
LIBLTDL=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIB_PREFIX=''
LIB_VERSION=''
LIPO=''
LN_S=''
LTDLDEPS=''
LTDLINCL=''
LTDLOPEN=''
LTLIBOBJS=''
LT_CONFIG_H=''
LT_DLLOADERS=''
LT_DLPREOPEN=''
MAKEINFO='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/missing --run makeinfo'
MANIFEST_TOOL=''
MKDIR_P='./install-sh -c -d'
MSQL_FALSE=''
MSQL_TRUE=''
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='unixODBC'
PACKAGE_BUGREPORT='nick@unixodbc.org '
PACKAGE_NAME='unixODBC'
PACKAGE_STRING='unixODBC 2.3.2-pre'
PACKAGE_TARNAME='unixodbc'
PACKAGE_URL=''
PACKAGE_VERSION='2.3.2-pre'
PATH_SEPARATOR=':'
PREFIX=''
PTH_CFLAGS=''
PTH_CPPFLAGS=''
PTH_LDFLAGS=''
PTH_LIBS=''
QNX_FALSE=''
QNX_TRUE=''
RANLIB=''
READLINE=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
SHLIBEXT=''
STRIP=''
SYSTEM_FILE_PATH=''
SYSTEM_LIB_PATH=''
VERSION='2.3.2'
WITHLT_FALSE=''
WITHLT_TRUE=''
YACC='bison -y'
YFLAGS=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/admin/sqlFiles/unixODBC-2.3.2/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
ltdl_LIBOBJS=''
ltdl_LTLIBOBJS=''
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/./install-sh -c -d'
msql_headers=''
msql_libraries=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
subdirs=''
sys_symbol_underscore=''
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME "unixODBC"
#define PACKAGE_TARNAME "unixodbc"
#define PACKAGE_VERSION "2.3.2-pre"
#define PACKAGE_STRING "unixODBC 2.3.2-pre"
#define PACKAGE_BUGREPORT "nick@unixodbc.org "
#define PACKAGE_URL ""
#define PACKAGE "unixODBC"
#define VERSION "2.3.2"
configure: exit 77
现在已经坚持了一段时间了,希望这个网站上的好人可以帮助我解决我的问题。
谢谢, 亚当
答案 0 :(得分:1)
您正在为非常不寻常的平台编译代码。尽管自动工具尽力在配置软件方面做得不错,但在这种情况下,您的系统和工具链太过异国情调。
不幸的是,你自己就是这个。最好的办法是在普通的Linux计算机上生成Makefile,然后将其用作平台端口的起点。
答案 1 :(得分:0)
日志的关键部分是这两行:
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/lib/gcc/arm-nilrt-linux-gnueabi/4.7.2/../../../../arm-nilrt-linux-gnueabi/bin/ld: cannot find -lgcc
对于任何gcc调用,C运行时启动代码(crtbegin.o)和libgcc.a默认链接。它们似乎丢失或位于意外位置,或者未定义位置。
我不是autotools专家(或Linux那个问题),但是"配置"似乎很奇怪。 line说:--exec_prefix=/usr
,然后日志显示exec_prefix='NONE'
,默认情况下,链接器用于这些文件的路径是${exec_prefix}/lib/gcc
我相信。
有许多environment variables that affect GCC,您可能需要明确设置其中一些;特别是GCC_EXEC_PREFIX
,也许是LIBRARY_PATH
。
答案 2 :(得分:0)
我认为这里的问题是autoconf生成的configure脚本会进行测试,以确定是否可以构建内容。但是,您使用的编译器(arm-nilrt-linux-gnueabi-gcc)不支持-qversion
选项或-V
选项,因此在这些测试中编译失败。为避免这种情况,您可以破解配置脚本,例如this question的答案。可能有更好的方法来解决这个问题。