我正在尝试构建我的 C 项目,它使用 DLL 中的方法,但我无法让它工作。
我一直有以下错误:
**** Internal Builder is used for build ****
gcc -oLibspotifyTest.exe main.o -lC:\Users\nbarraille\workspace\LibspotifyTest\lib\libspotify.dll
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lC:\Users\nbarraille\workspace\LibspotifyTest\lib\libspotify.dll
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 543 ms.
它说它找不到我的dll,但它在指定的路径。
我在 Windows 7 上使用带有 CDT 的 Eclipse Helios,这是 MinGW 的最新版本。
我的项目层次结构如下:
LibspotifyTest
Includes
C:/MinGW/include
C:/MinGW/lib/gcc/mingw32/4.5.2/include
C:/MinGW/lib/gcc/mingw32/4.5.2/include-fixed
LibspotifyTest/include
Debug
include
api.h
lib
libspotify.dll
libspotify.lib
Release
main.o
main.c
最佳答案
难道您不必指定 .lib 而不是 .dll 吗? - 所以对于 -l 它将 libspotify.lib
而不是 libspotify.dll
gcc -oLibspotifyTest.exe main.o -lC:\Users\nbarraille\workspace\LibspotifyTest\lib\libspotify.lib
关于c - MinGW/Eclipse C 构建问题 : cannot find dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5241729/