c++ - 重做安装程序(Linux)

标签 c++ linux makefile 64-bit 32bit-64bit

我 fork 了 setroot 并将其重命名为 mhsetroot。当我在运行 32 位 linux (Chrunchbang) 系统时向其中添加所有新功能时。现在我有了一台新的 64 位笔记本电脑,上面装有 Crunchbang。它也应该运行 32 位。但它不会使用 ./configure - make - sudo make install 安装我的程序。

第一次它说我的 .o 文件不兼容或类似的东西。所以我重新编译它,然后使用这条线再次尝试(第二天)

gcc `-m32 imlib2-config --cflags` `imlib2-config --libs` -o mhsetroot32 mhsetroot-v1.6.2.c

然后更改 .o 文件的名称以与前一个文件名称一致,然后执行 ./configure。这有效,但是,现在在我运行第一个“make”后,我现在收到此错误。

  dude@crunchbang64:~/downloads/mhsetroot-v1.6.2$ make
Making all in src
make[1]: Entering directory `/home/dude/downloads/mhsetroot-v1.6.2/src'
gcc -g -O2  -Wall -g -O2   -o mhsetroot mhsetroot-v1.6.2.o  -L/usr/lib      -lImlib2 -L/usr/lib/x86_64-linux-gnu -lfreetype -lz -lX11 -lXext -ldl -lm
mhsetroot-v1.6.2.o: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o:   (.fini+0x0): first defined here
mhsetroot-v1.6.2.o: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: (.data+0x0): first defined here
mhsetroot-v1.6.2.o: In function `__data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o:(.data+0x0): first defined here
mhsetroot-v1.6.2.o:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
mhsetroot-v1.6.2.o: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux- gnu/crt1.o:(.text+0x0): first defined here
mhsetroot-v1.6.2.o: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o:(.tm_clone_table+0x0): multiple definition of `__TMC_END__'
mhsetroot-v1.6.2.o:(.data+0x10): first defined here
/usr/bin/ld: error in mhsetroot-v1.6.2.o(.eh_frame); no .eh_frame_hdr table will be created.
collect2: error: ld returned 1 exit status
make[1]: *** [mhsetroot] Error 1
make[1]: Leaving directory `/home/dude/downloads/mhsetroot-v1.6.2/src'
make: *** [all-recursive] Error 1
dude@crunchbang64:~/downloads/mhsetroot-v1.6.2$ 

因为当我运行 32 位 Linux 时,我所做的就是找到一个旧的安装 makefile - 然后整个过程只是修改它以与我的程序一起工作,所以现在我该怎么做才能让它在我的 64 位 Linux 上再次工作?

最佳答案

这个

`-m32 imlib2-config --cflags`

不正确并且无法工作,因此这不可能是您实际使用的命令。

gcc 行也不会创建目标文件,而是创建二进制文件。

您离开了 -c 参数以停止编译。

这可能是问题所在,因为您随后继续尝试将一个二进制文件链接到另一个二进制文件。

关于c++ - 重做安装程序(Linux),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28745680/

相关文章:

c++ - 如何将源目录中的所有 cpp 文件编译为对象到单独的构建目录中

c++ - 编译器独立类型

mysql - 在 Debian 7 中更改 Mysql 数据目录?

linux - 验证服务器证书OpenSSL

linux - 使用 ./configure 命令安装程序时如何包含头文件

c++ - 将 it++ 与 cmake ( QT ) 一起使用

c++ - 公共(public)接口(interface)中使用的私有(private) typedef

c++ - cout 和 printf 中打印零的区别

c++ - 矩形重叠的数据结构

c++ - Linux C++ : Linker is outputting strange errors