jakogut/tinyvm

i have a complier error,please help

CCbird opened this issue · 6 comments

my environment is macos , when i make.

clang src/tvmi.c -ltvm -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -Llib/ -o bin/tvmi

ld: library not found for -ltvm

clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tvmi] Error 1

What's the output of make rebuild?

the output of make rebuild:

clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm.c -o libtvm/tvm.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_file.c -o libtvm/tvm_file.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_htab.c -o libtvm/tvm_htab.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_lexer.c -o libtvm/tvm_lexer.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_memory.c -o libtvm/tvm_memory.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_parser.c -o libtvm/tvm_parser.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_preprocessor.c -o libtvm/tvm_preprocessor.o
clang -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -c libtvm/tvm_program.c -o libtvm/tvm_program.o
clang src/tvmi.c -ltvm -Wall -pipe -Iinclude/ -std=gnu11 -Werror -pedantic -pedantic-errors -O3 -Llib/ -o bin/tvmi
ld: library not found for -ltvm
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [tvmi] Error 1

Try make libtvm

For whatever reason, it seems the static library isn't being built. If all else fails, you can try:

clang -Iinclude/ -std=gnu11 -O3 libtvm/*.c src/tvmi.c -o bin/tvmi

i try clang -Iinclude/ -std=gnu11 -O3 libtvm/*.c src/tvmi.c -o bin/tvmi,succeed!
but ,does this idea affect program running?

i make clean and uninstall ,then make or make rebuild can complier not error!
and the lib directory have a libtvm.a file. Does this situation represent success?

Yeah, you should just be able to run bin/tvmi now.