Skip to content

Instantly share code, notes, and snippets.

@elorest
Last active March 11, 2017 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elorest/2ae9fe3ef00024f4ac4894cb4bd715e2 to your computer and use it in GitHub Desktop.
Save elorest/2ae9fe3ef00024f4ac4894cb4bd715e2 to your computer and use it in GitHub Desktop.
ld: library not found for -l./helloworld.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: execution of command failed with code: 1: `cc -o "/Users/isaac/.cache/crystal/crystal-run-helloworld.tmp" "${@}" -rdynamic -l./helloworld.o -lpcre -lgc -lpthread /Users/isaac/.anyenv/envs/crenv/versions/0.21.0/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -L/usr/local/lib`
#include <stdio.h>
void hello( const char * name ) {
printf( "Hello, %s!\n", name );
}
#how would I got about linking to the above file?
@[Link("helloworld.o")]
lib Say
fun hello(name : LibC::Char*) : Void
end
puts Say.hello("isaac")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment