Skip to content

Linking sdl-demo/sdl_main.rs fails #126

@albertofem

Description

@albertofem

Hi, I'm trying to run the demo using the sdl_main.rs approach, but it does not seems to be working. This is the linking error I got:

error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-o' 'sdl_main' 'sdl_main.o' '-lmorestack' '-nodefaultlibs' '-Wl,--as-needed' '/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libnative-83574243-0.11-pre.rlib' '/home/.../sdl/libsdl-e351513a-0.3.2.rlib' '/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-dd29dab1-0.11-pre.rlib' '/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-aad93cea-0.11-pre.rlib' '/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-3574b280-0.11-pre.rlib' '-L.' '-L/home/.../sdl/.rust' '-L/home/.../sdl' '-Wl,-Bdynamic' '-lSDL' '-ldl' '-lpthread' '-lgcc_s' '-lc' '-lm' '-Wl,-rpath,$ORIGIN/../../../../../../../usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib' '-lcompiler-rt'
note: /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

error: aborting due to previous error

This is the Rust version I'm using:

rustc 0.11-pre-nightly (a5cd502 2014-04-22 02:06:35 -0700)
host: x86_64-unknown-linux-gnu

Running the main.rs demo worked fine. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions