multi-arch ld cannot find -lSDL or -LSDL-1.2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libsdl1.2 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm trying to compile a 32-bit application on Trusty x86-64. I've installed the libsdl1.2-dev and libsdl1.
#include <SDL/SDL.h>
int main(int argc, char* argv[])
{
if (SDL_Init(
exit(1);
}
SDL_Quit();
return 0;
}
The above trivial C application below builds just fine as 64-bit with the following command: gcc main.c -lSDL
But when I try to build it with the -m32 flag, using the command: gcc -m32 main.c -Wl,--verbose -lSDL
I get the following output:
GNU ld (GNU Binutils for Ubuntu) 2.24
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
i386pep
i386pe
using internal linker script:
=======
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_
<snipped/>
=======
attempt to open /usr/lib/
/usr/lib/
attempt to open /usr/lib/
/usr/lib/
attempt to open /usr/lib/
/usr/lib/
attempt to open /tmp/ccZi14Qh.o succeeded
/tmp/ccZi14Qh.o
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
i386pep
i386pe
using internal linker script:
=======
/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_
OUTPUT_ARCH(i386)
ENTRY(_start)
SEARCH_
<snipped/>
=======
attempt to open /usr/lib/
/usr/lib/
attempt to open /usr/lib/
/usr/lib/
attempt to open /usr/lib/
/usr/lib/
attempt to open /tmp/ccZi14Qh.o succeeded
/tmp/ccZi14Qh.o
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /lib/i386-
attempt to open /lib/i386-
attempt to open /lib/..
attempt to open /lib/..
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /lib/i386-
attempt to open /lib/i386-
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/i386-
attempt to open /usr/i386-
attempt to open /usr/x86_
attempt to open /usr/x86_
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //lib/i386-
attempt to open //lib/i386-
attempt to open //lib32/libSDL.so failed
attempt to open //lib32/libSDL.a failed
attempt to open //usr/lib/
attempt to open //usr/lib/
attempt to open //usr/lib32/
attempt to open //usr/lib32/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //lib/libSDL.so failed
attempt to open //lib/libSDL.a failed
attempt to open //usr/lib/libSDL.so failed
attempt to open //usr/lib/libSDL.a failed
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
-lgcc_s (/usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
opened script file /usr/lib/
opened script file /usr/lib/
attempt to open /lib32/libc.so.6 succeeded
/lib32/libc.so.6
attempt to open /usr/lib32/
(/usr/lib32/
attempt to open /lib32/
/lib32/
/usr/bin/ld: cannot find -lSDL
collect2: error: ld returned 1 exit status
nux-gnu/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /lib/i386-
attempt to open /lib/i386-
attempt to open /lib/..
attempt to open /lib/..
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /lib/i386-
attempt to open /lib/i386-
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/i386-
attempt to open /usr/i386-
attempt to open /usr/x86_
attempt to open /usr/x86_
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //lib/i386-
attempt to open //lib/i386-
attempt to open //lib32/libSDL.so failed
attempt to open //lib32/libSDL.a failed
attempt to open //usr/lib/
attempt to open //usr/lib/
attempt to open //usr/lib32/
attempt to open //usr/lib32/
attempt to open //usr/local/
attempt to open //usr/local/
attempt to open //lib/libSDL.so failed
attempt to open //lib/libSDL.a failed
attempt to open //usr/lib/libSDL.so failed
attempt to open //usr/lib/libSDL.a failed
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
-lgcc_s (/usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
attempt to open /usr/lib/
opened script file /usr/lib/
opened script file /usr/lib/
attempt to open /lib32/libc.so.6 succeeded
/lib32/libc.so.6
attempt to open /usr/lib32/
(/usr/lib32/
attempt to open /lib32/
/lib32/
/usr/bin/ld: cannot find -lSDL
collect2: error: ld returned 1 exit status
Status changed to 'Confirmed' because the bug affects multiple users.