Use 32bit shared library from 64bit application?

前端 未结 2 494
别那么骄傲
别那么骄傲 2021-01-16 12:48

I have created a simple linux 32bit shared library(.so) for my rendering wrappers but i\'ve hit a wall when i figured that i can only use them through 32bit applications....

2条回答
  •  粉色の甜心
    2021-01-16 13:13

    You can't do what you're asking. You must compile both the final executable and any libraries (both static and shared) for the same architecture.

    On GCC, this can be done easily by passing the command line argument -m32 either directly in the command line or by adding it CCFLAGS in your Makefile.

    While it is possible to run x86 code on a x86_64 operating system (you just need to have all the right libraries and their respective recursive dependencies), you cannot, in one executable or in one address space, combine x86 and x86_64 binaries.

提交回复
热议问题