gpt4 book ai didi

c - mingw ld 找不到搜索路径中存在的某些库

转载 作者:行者123 更新时间:2023-12-01 17:55:20 25 4
gpt4 key购买 nike

我用的是vim+mingw,不知怎么的,终端还是window命令。
所以我用谷歌搜索,并使用mintty。但是当运行 vim 时,它会永远挂起,直到我输入 C-c。
我发现this page,并且想尝试 winpty。
但是当我编译它时,它出现:

$ make
Linking ../build/console.exe
c:\mingw32\bin\ld.exe: cannot find -lpthread
c:\mingw32\bin\ld.exe: cannot find -luser32
c:\mingw32\bin\ld.exe: cannot find -lkernel32
c:\mingw32\bin\ld.exe: cannot find -ladvapi32
c:\mingw32\bin\ld.exe: cannot find -lshell32
collect2: ld returned 1 exit status
make: *** [../build/console.exe] Error 1

然后我尝试gcc -lpthread --verbose,它能够找到pthread.a。
然后我尝试ld -lpthread --verbose,输出是

==================================================
attempt to open /mingw/mingw32/lib/libpthread.dll.a failed
attempt to open /mingw/mingw32/lib/pthread.dll.a failed
attempt to open /mingw/mingw32/lib/libpthread.a failed
attempt to open /mingw/mingw32/lib/pthread.lib failed
attempt to open /mingw/mingw32/lib/libpthread.dll failed
attempt to open /mingw/mingw32/lib/pthread.dll failed
attempt to open /mingw/mingw32/lib\libpthread.a failed
attempt to open /mingw/lib/libpthread.dll.a failed
attempt to open /mingw/lib/pthread.dll.a failed
attempt to open /mingw/lib/libpthread.a failed
attempt to open /mingw/lib/pthread.lib failed
attempt to open /mingw/lib/libpthread.dll failed
attempt to open /mingw/lib/pthread.dll failed
attempt to open /mingw/lib\libpthread.a failed
attempt to open /usr/local/lib/libpthread.dll.a failed
attempt to open /usr/local/lib/pthread.dll.a failed
attempt to open /usr/local/lib/libpthread.a failed
attempt to open /usr/local/lib/pthread.lib failed
attempt to open /usr/local/lib/libpthread.dll failed
attempt to open /usr/local/lib/pthread.dll failed
attempt to open /usr/local/lib\libpthread.a failed
attempt to open /lib/libpthread.dll.a failed
attempt to open /lib/pthread.dll.a failed
attempt to open /lib/libpthread.a failed
attempt to open /lib/pthread.lib failed
attempt to open /lib/libpthread.dll failed
attempt to open /lib/pthread.dll failed
attempt to open /lib\libpthread.a failed
attempt to open /usr/lib/libpthread.dll.a failed
attempt to open /usr/lib/pthread.dll.a failed
attempt to open /usr/lib/libpthread.a failed
attempt to open /usr/lib/pthread.lib failed
attempt to open /usr/lib/libpthread.dll failed
attempt to open /usr/lib/pthread.dll failed
attempt to open /usr/lib\libpthread.a failed
attempt to open /mingw/mingw32/lib/libpthread.dll.a failed
attempt to open /mingw/mingw32/lib/pthread.dll.a failed
attempt to open /mingw/mingw32/lib/libpthread.a failed
attempt to open /mingw/mingw32/lib/pthread.lib failed
attempt to open /mingw/mingw32/lib/libpthread.dll failed
attempt to open /mingw/mingw32/lib/pthread.dll failed
attempt to open /mingw/mingw32/lib\pthread.lib failed
attempt to open /mingw/lib/libpthread.dll.a failed
attempt to open /mingw/lib/pthread.dll.a failed
attempt to open /mingw/lib/libpthread.a failed
attempt to open /mingw/lib/pthread.lib failed
attempt to open /mingw/lib/libpthread.dll failed
attempt to open /mingw/lib/pthread.dll failed
attempt to open /mingw/lib\pthread.lib failed
attempt to open /usr/local/lib/libpthread.dll.a failed
attempt to open /usr/local/lib/pthread.dll.a failed
attempt to open /usr/local/lib/libpthread.a failed
attempt to open /usr/local/lib/pthread.lib failed
attempt to open /usr/local/lib/libpthread.dll failed
attempt to open /usr/local/lib/pthread.dll failed
attempt to open /usr/local/lib\pthread.lib failed
attempt to open /lib/libpthread.dll.a failed
attempt to open /lib/pthread.dll.a failed
attempt to open /lib/libpthread.a failed
attempt to open /lib/pthread.lib failed
attempt to open /lib/libpthread.dll failed
attempt to open /lib/pthread.dll failed

然后我尝试find/mingw -name *pthread*输出是

$ find /mingw -name *pthread*
/mingw/bin/pthreadGC2.dll
/mingw/bin/pthreadGCE2.dll
/mingw/include/pthread.h
/mingw/lib/libpthread.a
/mingw/lib/libpthread.dll.a
/mingw/lib/libpthreadGC2.a
/mingw/lib/libpthreadGC2.dll.a
/mingw/lib/libpthreadGCE2.dll.a
/mingw/mingw32/include/pthread.h
/mingw/mingw32/lib/libpthread.a
/mingw/mingw32/lib/libpthread.dll.a
/mingw/mingw32/lib/libpthreadGC2.a
/mingw/mingw32/lib/libpthreadGC2.dll.a
/mingw/mingw32/lib/libpthreadGCE2.dll.a
/mingw/msys/1.0/include/pthread.h
/mingw/share/doc/pthreads-w32
/mingw/share/doc/pthreads-w32/2.9.1/README.pthreads-w32-2.9.1-1-mingw32
/mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma
/mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-dll.tar.lzma
/mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-doc.tar.lzma
/mingw/var/cache/mingw-get/packages/pthreads-w32-2.9.1-1-mingw32-lic.tar.lzma
/mingw/var/lib/mingw-get/data/mingw32-pthreads-w32.xml

天哪,邪恶在哪里? \/
帮助pppppppppp:|

最佳答案

如果有人感兴趣,请检查您的配置脚本。当您将 *nix\与 windows/混为一谈时,就会出现此问题

关于c - mingw ld 找不到搜索路径中存在的某些库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21596268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com