【发布时间】:2015-04-29 00:29:36
【问题描述】:
我分叉了 setroot 并将其重命名为 mhsetroot。当我在运行 32 位 linux (Chrunchbang) 系统时添加所有新功能时。现在我得到了一台带有 Crunchbang 的新 64 位笔记本电脑。它也应该运行 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?
【问题讨论】:
-
如果你想要一个 32 位的可执行文件,你必须将
-m32添加到 both 编译 和 链接行。您在上面的链接行中没有它。正如 Etan 指出的那样,您的示例非常糟糕,因此它显然不是您实际使用的:请直接从终端使用剪切和粘贴到问题,而不是尝试手动重新输入。您在转录中犯的错字将从根本上削弱我们提供帮助的能力。 -
复制粘贴到代码区
-
我说的是你的编译行,在第一个代码示例中,正如 Etan 在下面指出的那样。您的第二个代码示例显示 LINK 行,但不显示 compile 行。该链接失败了,但正如 Etan 指出的那样,它可能由于编译步骤中的错误而失败。您在此处引用的编译步骤显然无效,因此我们不确定链接行中使用的目标文件是如何创建的,因此我们无法提供帮助。
标签: c++ linux makefile 64-bit 32bit-64bit