2011-11-26 4 views
1

한 시간 동안 이것을 알아 내려고 노력했습니다. 내가 가지고있는 것은 Qt Creator에서 열리는 간단한 Qt 프로젝트입니다. 내가하고 싶은 것은 Qt 프로젝트에서 SDL 라이브러리 (dll)를 사용하는 것이다.Qt 프로젝트에서 제 3 자 dll/라이브러리를 참조하는 방법

Visual Studio에서 내가하는 것은 VS 도구를 사용하여이 DLL에 대한 참조를 추가하는 것입니다. Qt는 크리에이터, 나는 내 프로젝트에 대한 .pro 파일을 열, 그리고 내 사용을위한 Qt는의 라이브러리를 포함하지 않는 것 STD의 DLL 그러나

# Add more folders to ship with the application, here 
folder_01.source = qml/BoxGame 
folder_01.target = qml 
DEPLOYMENTFOLDERS = folder_01 

# Additional import path used to resolve QML modules in Creator's code model 
QML_IMPORT_PATH = 

symbian:TARGET.UID3 = 0xEED812B5 

# Smart Installer package's UID 
# This UID is from the protected range and therefore the package will 
# fail to install if self-signed. By default qmake uses the unprotected 
# range value if unprotected UID is defined for the application and 
# 0x2002CCCF value if protected UID is given to the application 
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF 

# Allow network access on Symbian 
symbian:TARGET.CAPABILITY += NetworkServices 

# If your application uses the Qt Mobility libraries, uncomment the following 
# lines and add the respective components to the MOBILITY variable. 
# CONFIG += mobility 
# MOBILITY += 
LIBS += C:\Users\vata\Desktop\DskProj\Dsk-build-desktop\debug\SDL.dll 


# The .cpp file which was generated for your project. Feel free to hack it. 
SOURCES += main.cpp \ 
    blockboxes.cpp \ 
    block.cpp \ 
    boxengine.cpp \ 
    boxgame.cpp \ 
    point.cpp \ 
    gamecontroller.cpp \ 
    gamecontrollermod.cpp 

# Please do not modify the following two lines. Required for deployment. 
include(qmlapplicationviewer/qmlapplicationviewer.pri) 
qtcAddDeployment() 

HEADERS += \ 
    blockboxes.h \ 
    block.h \ 
    boxengine.h \ 
    boxgame.h \ 
    Globals.h \ 
    point.h \ 
    gamecontroller.h \ 
    gamecontrollermod.h \ 
    controller.h 

위한 LIB 항목을 추가했다. 컴파일 할 때 나는 여전히 SDL.h: No such file or directory 오류 메시지를받습니다. 내 개발 작업을 위해 Qt를 사용하는 경향이 더 커지므로이 문제를 파악하고 미래에 대해 배우는 데 도움이 될 것입니다.

LIBS += -LC:\\Users\\vata\\Desktop\\DskProj\\Dsk-build-desktop\\debug -lsdl

답변

0

. 컴파일러가 그것을 찾으려면, qmake의 INCLUDEPATH에 디렉토리를 추가해야한다. 예를 들어 :

INCLUDEPATH += C:/Dir/Where/SDL/Headers/Are/Found

(팁 : 당신은 / 대신 \는 이스케이프 문자로 \의 가능한 해석의 명확한 머물 수 있습니다.)

+0

그냥 그 테스트가 작동하지 않았다. – Kobojunkie

+1

@ Kobojunkie : 시도'LIBS + = "C : /Users/vata/Desktop/DskProj/Dsk-build-desktop/debug/SDL.dll" –

+0

그 중 하나가 작동하지 않았다. – Kobojunkie

2

SDL.h는 C 헤더 파일이 아닌 라이브러리입니다 : 뭔가를 시도

Running build steps for project Tetris... 
Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe" clean 
C:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug clean 
관련 문제