starwing / lua-protobuf

A Lua module to work with Google protobuf
MIT License
1.75k stars 387 forks source link

ld: can't write output file: pb.so for architecture x86_64 #15

Closed yhhwatl closed 6 years ago

yhhwatl commented 6 years ago

Mac : yhh:lua-protobuf watl$ gcc -O2 -shared -undefined dynamic_lookup pb.c -o pb.so ld: can't write output file: pb.so for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) yhh:lua-protobuf watl$ gcc -O2 -shared -undefined dynamic_lookup pb.c -o pb.so -v Apple LLVM version 9.0.0 (clang-900.0.39.2) Target: x86_64-apple-darwin17.3.0 Thread model: posix InstalledDir: /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name pb.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 305 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0 -O2 -fdebug-compilation-dir /Volumes/Mac/Documents/workspace/lua-protobuf -ferror-limit 19 -fmessage-length 181 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.13.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /var/folders/8z/77k5pp_95pg0blphwr1bmqk00000gn/T/pb-d0a484.o -x c pb.c clang -cc1 version 9.0.0 (clang-900.0.39.2) default target x86_64-apple-darwin17.3.0

include "..." search starts here:

include <...> search starts here:

/usr/local/include /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. "/Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -dylib -arch x86_64 -macosx_version_min 10.13.0 -undefined dynamic_lookup -undefined dynamic_lookup -o pb.so /var/folders/8z/77k5pp_95pg0blphwr1bmqk00000gn/T/pb-d0a484.o -lSystem /Volumes/Mac/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/lib/darwin/libclang_rt.osx.a ld: can't write output file: pb.so for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) yhh:lua-protobuf watl$

starwing commented 6 years ago

it semms that you toolchains has issues? do you have write permission on current work folder? try use clang directly?

starwing commented 6 years ago

no further feedback, close