我正在使用vim + mingw,无论如何,终端仍然是window命令。
所以我用谷歌搜索它,并使用薄荷。但是当运行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
哦,上帝,邪恶在哪里?
\
和/
?helppppppppppp:|
最佳答案
如果有人感兴趣,请检查您的配置脚本。当您将* nix \与Windows /混淆时,就会出现此问题
关于c - mingw ld无法找到搜索路径中存在的某些库,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21596268/