How to create a 32bit shared library on a 64bit system?

Dizzy dizzy at roedu.net
Wed Jun 13 14:08:30 BST 2007


On Wednesday 13 June 2007 15:38, Armin Lambacher wrote:
> Hello,
<snip>
> Interestingly the last line seems to indicate a successful build of the
> project, however, there are some issues with linking, see the lines
>
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld
>: warning: i386 architecture of input file
> `CMakeFiles/so_test.dir/so_test.o' is incompatible with i386:x86-64 output
>
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld
>: warning: i386 architecture of input file
> `CMakeFiles/so_testtest.dir/so_testtest.o' is incompatible with i386:x86-64
> output
>
> The program crashes upon starting it with SIGSEGV.
>
> Can somebody please put me into the right directon on how to solve this
> problem?

I think you need to add -m32 to both the compiler and linker. I 
compiled/linked x86 programs on x86-64 (with -m32) quite a few times and had 
no issues. I didn't used CMake tho or SuSe.

-- 
Mihai RUSU					Email: dizzy at roedu.net
			"Linux is obsolete" -- AST




More information about the KDevelop mailing list