铛错误“ ld:找不到-lkernel32的库”

时间:2019-01-09 18:51:18

标签: c++ xcode clang

我尝试使用带有库“ libxd”的c ++制作一个简单的应用程序,但出错了。

当我尝试使用此命令编译草图时

g++ -std=c++11 sketch.cpp -o sketch -Iinclude -Llib -lxd -lglad -lglfw3 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32

我遇到以下错误:clang: error: linker command failed with exit code 1 (use -v to see invocation)。当我尝试将标志“ -v”添加到命令时,得到以下输出:


    Apple LLVM version 10.0.0 (clang-1000.10.44.4)
    Target: x86_64-apple-darwin18.2.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
     "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name sketch.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 409.12 -v -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0 -I include -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/vovinkomp/Downloads/libxd-0.3.2-Darwin -ferror-limit 19 -fmessage-length 204 -stack-protector 1 -fblocks -fencode-extended-block-signature -fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/4k/_p284mr90szcx2kzzt8l8kpr0000gp/T/sketch-f1eccb.o -x c++ sketch.cpp
    clang -cc1 version 10.0.0 (clang-1000.10.44.4) default target x86_64-apple-darwin18.2.0
    ignoring nonexistent directory "/usr/include/c++/v1"
    #include "..." search starts here:
    #include <...> search starts here:
     include
     /Library/Developer/CommandLineTools/usr/include/c++/v1
     /usr/local/include
     /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/include
     /Library/Developer/CommandLineTools/usr/include
     /usr/include
     /System/Library/Frameworks (framework directory)
     /Library/Frameworks (framework directory)
    End of search list.
     "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.14.0 -o sketch -Llib /var/folders/4k/_p284mr90szcx2kzzt8l8kpr0000gp/T/sketch-f1eccb.o -lxd -lglad -lglfw3 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -lkernel32 -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.0/lib/darwin/libclang_rt.osx.a
    ld: library not found for -lkernel32
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

如果有人知道如何解决此问题,请帮忙)

0 个答案:

没有答案