2011-03-09 27 views
1

我想建立我的C項目,它使用DLL的方法,但我不能讓它工作。MinGW/Eclipse的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,但它是在指定的路徑。

我使用Eclipse赫利俄斯與CDT,MinGW的最新版本,在Windows 7

我的項目層次結構如下:

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 

回答

0

你沒有指定。 lib而不是.dll? - 因此對於-l它將libspotify.lib和不libspotify.dll

GCC -oLibspotifyTest.exe main.o -lC:\用戶\ nbarraille \工作空間\ LibspotifyTest \ lib中\ libspotify.lib

+0

我試過,但我有同樣的問題: 「找不到-lC:\用戶\ nbarraille \工作區\ LibspotifyTest \ LIB \ libspotify.lib」 – nbarraille 2011-03-09 12:06:06

0

指定當完整路徑圖書館省略了-l,如:

gcc -o LibspotifyTest.exe main.o C:\foo\lib\libspotify.lib