{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/381","labels_url":"https://api.github.com/repos/manastech/crystal/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/381/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/381/events","html_url":"https://github.com/manastech/crystal/issues/381","id":56331836,"number":381,"title":"/samples/sdl/fire.cr compiler error","user":{"login":"weskinner","id":279526,"avatar_url":"https://avatars.githubusercontent.com/u/279526?v=3","gravatar_id":"","url":"https://api.github.com/users/weskinner","html_url":"https://github.com/weskinner","followers_url":"https://api.github.com/users/weskinner/followers","following_url":"https://api.github.com/users/weskinner/following{/other_user}","gists_url":"https://api.github.com/users/weskinner/gists{/gist_id}","starred_url":"https://api.github.com/users/weskinner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weskinner/subscriptions","organizations_url":"https://api.github.com/users/weskinner/orgs","repos_url":"https://api.github.com/users/weskinner/repos","events_url":"https://api.github.com/users/weskinner/events{/privacy}","received_events_url":"https://api.github.com/users/weskinner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-03T04:15:41Z","updated_at":"2015-02-03T19:15:44Z","closed_at":null,"body":"When I try to compile the sdl \"fire.cr\" sample I get the following compiler error:\r\n\r\nwilliam@ubuntu:~/Downloads/crystal-0.5.8/samples/sdl$ crystal run --link-flags -lSDL fire.cr\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 21\r\n/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2\r\n/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/crt1.o: In function `_start':\r\n(.text+0x20): undefined reference to `main'\r\ncollect2: error: ld returned 1 exit status\r\nError: execution of command failed with code: 1: `cc -o /tmp/crystal-run-fire.ZYGacD .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/main.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/CFileIO.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40Pointer40UInt84141.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Slice40T41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Slice40Pointer40UInt84141.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40String41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/GC.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Math.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40String41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/ArgumentError.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40UInt6441.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40ABI5858UnwindException41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/UInt64.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40UInt841.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/String.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/StringIO.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Slice40UInt841.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/IndexOutOfBounds.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/DivisionByZero.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/StaticArray40UInt844322241.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Exception.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Int32.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/YellowColorPattern.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/MagentaColorPattern.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/CyanColorPattern.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40ColorPattern4341.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40ColorPattern4341.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/RainbowColorPattern.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40MainPoint41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40MainPoint41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Float64.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/MainPoint.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Points.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40Point4341.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40Point4341.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/SDL.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40LibSDL5858Surface41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/SDL5858Surface.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Screen.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40T41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40UInt3241.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/StaticArray40UInt844321241.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40UInt3241.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/File.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40Rectangle41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40Rectangle41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/CharReader.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Bool.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Char.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Errno.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Rectangle.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Array40Bool41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Pointer40Bool41.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/UInt8.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/UInt32.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/StaticArray40UInt84432441.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/AtExitHandlers.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Exception43.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Process.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/LibSDL5858Key.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Point43.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/ColorPattern43.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/Point.o .crystal//home/william/Downloads/crystal-0.5.8/samples/sdl/fire.cr/LEBReader.o -lSDL  -lpcre -lm -lgc -lpthread -lunwind`\r\n"},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/72714825","html_url":"https://github.com/manastech/crystal/issues/381#issuecomment-72714825","issue_url":"https://api.github.com/repos/manastech/crystal/issues/381","id":72714825,"user":{"login":"ysbaddaden","id":47380,"avatar_url":"https://avatars.githubusercontent.com/u/47380?v=3","gravatar_id":"","url":"https://api.github.com/users/ysbaddaden","html_url":"https://github.com/ysbaddaden","followers_url":"https://api.github.com/users/ysbaddaden/followers","following_url":"https://api.github.com/users/ysbaddaden/following{/other_user}","gists_url":"https://api.github.com/users/ysbaddaden/gists{/gist_id}","starred_url":"https://api.github.com/users/ysbaddaden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ysbaddaden/subscriptions","organizations_url":"https://api.github.com/users/ysbaddaden/orgs","repos_url":"https://api.github.com/users/ysbaddaden/repos","events_url":"https://api.github.com/users/ysbaddaden/events{/privacy}","received_events_url":"https://api.github.com/users/ysbaddaden/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T19:15:44Z","updated_at":"2015-02-03T19:15:44Z","body":"I have the same problem on Linux too. The `-lSDL` isn't automatically added to the `cc` command. That may have something to do with calls to `pkg-config`.\r\n\r\nI don't know enough of the internals to know better. That may be a good opportunity to dig in!"}}