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:
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:
/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?
I've also tried the objcopy
with --output elf64-x86-64
, and this compiles correctly however the contents are garbled up when reading.
Original guide which inspired me