简体   繁体   English

GCC:输入文件“ ../window.ui.o”的i386体系结构与i386:x86-64输出不兼容

[英]GCC: i386 architecture of input file `../window.ui.o' is incompatible with i386:x86-64 output

I'm trying to embed a file called window.ui into my C executable, with the goal to access the contents later from within the code: 我试图将一个名为window.ui的文件嵌入到我的C可执行文件中,目的是以后从代码中访问内容:

objcopy --input binary \
        --output elf32-i386 \
        --binary-architecture i386 ../src/window.ui ../window.ui.o

gcc `pkg-config --cflags gtk+-3.0` \
    ../src/*.c \
    ../*.o \
    `pkg-config --libs gtk+-3.0` \
    -o ../a.out

When compiling, GCC fails with the following error: 编译时,GCC失败,并出现以下错误:

/usr/bin/x86_64-linux-gnu-ld: i386 architecture of input file `../window.ui.o' is incompatible with i386:x86-64 output
collect2: error: ld returned 1 exit status

Is there any way to force GCC to still include the file? 有什么方法可以强制GCC仍然包含该文件?

I've also tried the objcopy with --output elf64-x86-64 , and this compiles correctly however the contents are garbled up when reading. 我也用--output elf64-x86-64尝试了objcopy ,它可以正确编译, 但是读取时内容乱码了。


Original guide which inspired me 启发我的原始指南

"solved" by using gnu-ld instead: 通过使用gnu-ld来“解决”:

ld -r -b binary ../src/window.ui -o ../window.ui.o

Couldn't figure out why objcopy didn't work though. 无法弄清楚为什么objcopy无法正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 链接问题:i386:x86-64输入文件架构* .o与i386输出不兼容 - linking problem: i386:x86-64 architecture of input file *.o is incompatible with i386 output CMake; 386:x86-64 输入文件架构 (..) 与 i386 不兼容 output - CMake; 386:x86-64 architecture of input file (.. ) is incompatible with i386 output c ) 出错和链接问题:输入文件的 i386:x86-64 架构,与 i386 不兼容 output - c )make error& link problem: i386:x86-64 architecture of input file, incompatible with i386 output gcc ld:找不到架构i386的符号 - gcc ld: symbol(s) not found for architecture i386 文件是为i386构建的,而不是在Mac OSX 10.6上为iOS 4.2编译OpenCV2.2时所链接的架构(x86_64) - file was built for i386 which is not the architecture being linked (x86_64) while compiling OpenCV2.2 for iOS 4.2 on Mac OSX 10.6 GNU链接器和体系结构i386 - GNU Linker and architecture i386 从i386移动到x86_64时的浮点精度 - Floating-point precision when moving from i386 to x86_64 C sscanf i386 与 x86_64 解析引用字符串的不同行为 - C different behavior of sscanf i386 vs x86_64 parsing quoted string timer_create在i386系统上导致分段错误,但在x86_64系统上未引起分段错误(linux) - timer_create causing segmentation fault on i386 system, but not x86_64 system(linux) 为i386编译x264 - Compiling x264 for i386
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM