{"action":"created","issue":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/2003","repository_url":"https://api.github.com/repos/crystal-lang/crystal","labels_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2003/labels{/name}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2003/comments","events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2003/events","html_url":"https://github.com/crystal-lang/crystal/issues/2003","id":125809523,"number":2003,"title":"Can't compile program statically","user":{"login":"inem","id":9665,"avatar_url":"https://avatars.githubusercontent.com/u/9665?v=3","gravatar_id":"","url":"https://api.github.com/users/inem","html_url":"https://github.com/inem","followers_url":"https://api.github.com/users/inem/followers","following_url":"https://api.github.com/users/inem/following{/other_user}","gists_url":"https://api.github.com/users/inem/gists{/gist_id}","starred_url":"https://api.github.com/users/inem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inem/subscriptions","organizations_url":"https://api.github.com/users/inem/orgs","repos_url":"https://api.github.com/users/inem/repos","events_url":"https://api.github.com/users/inem/events{/privacy}","received_events_url":"https://api.github.com/users/inem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crystal-lang/crystal/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-01-10T09:14:46Z","updated_at":"2016-04-28T06:01:44Z","closed_at":null,"body":"I want to share executable, and therefore I want to compile my crystal program statically.\r\n\r\nIt looks like it needs these libs:\r\n```\r\n/usr/local/opt/libevent/lib/libevent-2.0.5.dylib\r\n/usr/local/opt/libpcl/lib/libpcl.1.dylib\r\n/usr/local/opt/bdw-gc/lib/libgc.1.dylib\r\n```\r\n\r\nBut when I try to compile it I get:\r\n```bash\r\ncrystal build activity.cr --link-flags \"-static -L/usr/local/opt/libevent/lib/\" \r\nld: library not found for -lcrt0.o\r\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\r\nError: execution of command failed with code: 1: `/usr/bin/gcc -o \"activity\" \"${@}\" -static -L/usr/local/opt/libevent/lib/ -rdynamic  -levent -lpcl -lpcre -lgc -lpthread -ldl`\r\n```\r\n\r\nDoes anybody have an idea what am I doing wrong and how to do it properly?\r\n\r\nI am on OSX 10.11, Crystal v0.10.0 "},"comment":{"url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments/215317691","html_url":"https://github.com/crystal-lang/crystal/issues/2003#issuecomment-215317691","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2003","id":215317691,"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":"2016-04-28T06:01:44Z","updated_at":"2016-04-28T06:01:44Z","body":"That should have linked the static library, but I guess the linker decided to use the shared libraries instead :-("}}