c - MinGW/Eclipse C 构建问题 : cannot find dll

标签 c eclipse gcc build mingw

我正在尝试构建我的 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/

相关文章:

c - 不同的浮点输入和输出

C结构内存管理

C 中的计算天数函数

java - 签署 Android 应用程序时出现 Proguard 错误/Dalvik 错误 1

android - clock_gettime 的 Ubuntu-to-Android 交叉编译链接

c - 使用PBLAS算法进行矩阵计算-使用MPI的多线程

eclipse - 直接部署我的项目而不总是复制war文件

c - 自动化 C 单元测试

c - 引用位时 `pop` 的含义

gcc - 达夫的设备还有用吗?