Debian 交叉编译:链接到mysql、liblog4cpp等

Debian 交叉编译:链接到mysql、liblog4cpp等,debian,cross-compiling,Debian,Cross Compiling,我试图交叉编译一个ARM处理器系统的项目。我可以通过建筑步骤,但在连接处失败 有问题的应用程序链接到liblog4cpp和libmysql。为了使构建工作正常,我从ARM系统中复制了相关文件,但似乎存在运行时依赖关系。具体错误: /usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld: warning: libz.so.1, needed by /usr/lib/mysql_arm/libmysq

我试图交叉编译一个ARM处理器系统的项目。我可以通过建筑步骤,但在连接处失败

有问题的应用程序链接到
liblog4cpp
libmysql
。为了使构建工作正常,我从ARM系统中复制了相关文件,但似乎存在运行时依赖关系。具体错误:

/usr/lib/gcc/arm-linux-gnueabi/4.4.5/../../../../arm-linux-gnueabi/bin/ld:  
  warning: libz.so.1, needed by /usr/lib/mysql_arm/libmysqlclient.so,   
  not found (try using -rpath or -rpath-link)   
/usr/lib/mysql_arm/libmysqlclient.so: undefined reference to `compress'
/usr/lib/mysql_arm/libmysqlclient.so: undefined reference to `uncompress'
collect2: ld returned 1 exit status
在我的构建步骤中,我链接到libz.so,但是使用
-rpath
的建议让我怀疑mysql库是否需要运行时链接。如果我在构建系统上设置这个值,当它在运行系统上找不到相应的路径时,它会不高兴吗


或者-是否有方法使用
apt get
为其他目标安装文件?我从emdebian安装了交叉编译器,但我看不到一种方法可以在不损坏构建系统的情况下获取特定目标的库文件。

对于后代:如果您希望包含其他库并遇到此类错误消息:

使用
-rpath链接
指向包含其他运行时库的文件夹。需要注意的是,您的build语句(在本例中为arm-linux-gnueabi-g++)必须使用-Wl、作为类似命令的开头。因此,生成的命令类似于:

arm-linux-gnueabi-g++ -Wall -O0 <other params here> file0.o file1.o 
  -Wl,-rpath-link /usr/lib/<path to arm library for run-time> 
  -L <some other library path> -l <something like mysql or bluetooth>
arm-linux-gnueabi-g++-Wall-O0 file0.o file1.o
-Wl,-rpath链接/usr/lib/
-L-L

重要的部分是第二行。这在生成计算机及其运行的计算机上得到正确解决。

对于后代:如果要包括其他库并遇到此类错误消息:

使用
-rpath链接
指向包含其他运行时库的文件夹。需要注意的是,您的build语句(在本例中为arm-linux-gnueabi-g++)必须使用-Wl、作为类似命令的开头。因此,生成的命令类似于:

arm-linux-gnueabi-g++ -Wall -O0 <other params here> file0.o file1.o 
  -Wl,-rpath-link /usr/lib/<path to arm library for run-time> 
  -L <some other library path> -l <something like mysql or bluetooth>
arm-linux-gnueabi-g++-Wall-O0 file0.o file1.o
-Wl,-rpath链接/usr/lib/
-L-L
重要的部分是第二行。这在构建机器及其运行机器上得到正确解决